New Landing How can we help? Themeforest Theme Support Neighborhood A few issues after updating a few times

Viewing 10 posts - 31 through 40 (of 40 total)
  • #216030
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    It’s not necessary, just copy the entire function sf_page_heading() to the functions.php of your child theme and changing has desired.

    -Rui

    #216034
    MarcusRG
    Member
    Post count: 69

    Yeah, you lost me there.

    Can you give me a quick step by step?

    #216037
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    go to the sp-page-heading.php file and copy the entire sf_page_heading() function like this

    
        /* PAGE HEADING
        ================================================== */
        if ( ! function_exists( 'sf_page_heading' ) ) {
            function sf_page_heading() {
    
                global $wp_query, $post;
                
                $shop_page  = false;
                $show_page_title = false;
                $page_title_bg = "";
                
                $page_title = $page_subtitle = $page_title_style = $page_title_overlay_effect = $fancy_title_image_url = $article_heading_bg = $article_heading_text = $page_heading_el_class = $page_design_style = $extra_styles = $page_title_text_align = "";
    						
                $show_page_title    = apply_filters( 'sf_page_heading_ns_pagetitle', 1 );
                $remove_breadcrumbs = apply_filters( 'sf_page_heading_ns_removebreadcrumbs', 0 );
                $page_title_height  = 300;
                $page_title_style   = "standard";
    
    			// Shop page check
                if ( ( function_exists( 'is_shop' ) && is_shop() ) || ( function_exists( 'is_product_category' ) && is_product_category() ) ) {
                    $shop_page = true;
                }
    
                // Defaults
                $options = get_option('sf_neighborhood_options');
                $default_page_heading_bg_alt = $options['default_page_heading_bg_alt'];
                $default_show_page_heading = $options['default_show_page_heading'];
    	
                // Post meta
                if ( $post && is_singular() ) {
                    $show_page_title       = sf_get_post_meta( $post->ID, 'sf_page_title', true );
                    $remove_breadcrumbs    = sf_get_post_meta( $post->ID, 'sf_no_breadcrumbs', true );
                    $page_title            = sf_get_post_meta( $post->ID, 'sf_page_title_one', true );
                    $page_subtitle         = sf_get_post_meta( $post->ID, 'sf_page_subtitle', true );
                    
                    $page_title_bg = sf_get_post_meta($post->ID, 'sf_page_title_bg', true);
                    
                    if ($show_page_title == "") {
                    	$show_page_title = $default_show_page_heading;
                    }
                    if ($page_title_bg == "") {
                    	$page_title_bg = $default_page_heading_bg_alt;
                    }
                } else {
                	$page_title_bg = $default_page_heading_bg_alt;
                }
                
                // Woo setup
                if ( $shop_page ) {
                    $show_page_title = apply_filters( 'woocommerce_show_page_title', true );
    
                    if ( is_product_category() ) {
                    	$category = $wp_query->get_queried_object();
                    	$hero_id = get_woocommerce_term_meta( $category->term_id, 'hero_id', true  );
                    	if ( $hero_id != "" && $hero_id != 0 ) {
                    		$fancy_title_image_url = wp_get_attachment_url($hero_id, 'full');
                    	}
                    }
                }
    
                // Page Title
                if ( $show_page_title == "" ) {
                    $show_page_title = $default_show_page_heading;
                }
                if ( $page_title == "" ) {
                    $page_title = get_the_title();
                }
                if ( $page_title_height == "" ) {
                    $page_title_height = apply_filters( 'sf_shop_fancy_page_height', 300 );
                }
    
                // Page Title Hidden
                if ( ! $show_page_title ) {
                    $page_heading_el_class = "page-heading-hidden";
                }
                
                ?>
    				
    			<div class="page-heading <?php echo esc_attr($page_heading_el_class); ?> clearfix asset-bg <?php echo $page_title_bg; 
    				?>">
                    <div class="container">
                        <div class="heading-text">
    
                            <?php if ( sf_woocommerce_activated() && is_woocommerce() ) { ?>
    
                                <?php if ( is_product() ) { ?>
    
                                    <h1 class="entry-title" <?php echo $article_heading_text; ?>><?php echo esc_attr($page_title); ?></h1>
    
                                <?php } else { ?>
    
                                    <h1 class="entry-title" <?php echo $article_heading_text; ?>><?php woocommerce_page_title(); ?></h1>
    
                                <?php } ?>
    
                            <?php } else if ( is_search() ) { ?>
    
                                <?php
                                $s         = get_search_query();
                                $allsearch = new WP_Query( "s=$s&showposts=-1" );
                                $key       = esc_html( $s, 1 );
                                $count     = $allsearch->post_count;
                                wp_reset_query(); ?>
                                <?php if ( $count == 1 ) : ?>
                                    <?php printf( __( '<h1>%1$s result for <span>%2$s</span></h1>', 'swiftframework' ), $count, get_search_query() ); ?>
                                <?php else : ?>
                                    <?php printf( __( '<h1>%1$s results for <span>%2$s</span></h1>', 'swiftframework' ), $count, get_search_query() ); ?>
                                <?php endif; ?>
    
                            <?php } else if ( is_category() ) { ?>
    
                                <h1 <?php echo $article_heading_text; ?>><?php single_cat_title(); ?></h1>
    
                            <?php } else if ( is_archive() ) { ?>
    
                                <?php /* If this is a tag archive */
                                if ( is_tag() ) { ?>
                                    <h1 <?php echo $article_heading_text; ?>><?php _e( "Posts tagged with", "swiftframework" ); ?>
                                        &#8216;<?php single_tag_title(); ?>&#8217;</h1>
                                    <?php /* If this is a daily archive */
                                } elseif ( is_day() ) { ?>
                                    <h1 <?php echo $article_heading_text; ?>><?php _e( "Archive for", "swiftframework" ); ?> <?php the_time( 'F jS, Y' ); ?></h1>
                                    <?php /* If this is a monthly archive */
                                } elseif ( is_month() ) { ?>
                                    <h1 <?php echo $article_heading_text; ?>><?php _e( "Archive for", "swiftframework" ); ?> <?php the_time( 'F, Y' ); ?></h1>
                                    <?php /* If this is a yearly archive */
                                } elseif ( is_year() ) { ?>
                                    <h1 <?php echo $article_heading_text; ?>><?php _e( "Archive for", "swiftframework" ); ?> <?php the_time( 'Y' ); ?></h1>
                                    <?php /* If this is an author archive */
                                } elseif ( is_author() ) { ?>
                                    <?php $author = get_userdata( get_query_var( 'author' ) ); ?>
                                    <?php if ( class_exists( 'ATCF_Campaigns' ) ) { ?>
                                        <h1 <?php echo $article_heading_text; ?>><?php _e( "Projects by", "swiftframework" ); ?> <?php echo esc_attr($author->display_name); ?></h1>
                                    <?php } else { ?>
                                        <h1 <?php echo $article_heading_text; ?>><?php _e( "Author archive for", "swiftframework" ); ?> <?php echo esc_attr($author->display_name); ?></h1>
                                    <?php } ?>
                                    <?php /* If this is a paged archive */
                                } elseif ( isset( $_GET['paged'] ) && ! empty( $_GET['paged'] ) ) { ?>
                                    <h1 <?php echo $article_heading_text; ?>><?php _e( "Blog Archives", "swiftframework" ); ?></h1>
                                <?php } else { ?>
                                    <h1 <?php echo $article_heading_text; ?>><?php post_type_archive_title(); ?></h1>
                                <?php } ?>
    
                            <?php } else if ( is_404() ) { ?>
    
                                <h1 class="entry-title" <?php echo $article_heading_text; ?>><?php _e( "404", "swiftframework" ); ?></h1>
    
                            <?php } else { ?>
    
                                <h1 class="entry-title" <?php echo $article_heading_text; ?>><?php echo $page_title; ?></h1>
    
                            <?php } ?>
    
                        </div>
    
    					<?php if ( !$remove_breadcrumbs ) {
    						echo sf_breadcrumbs( true );
    					} ?>
    
                    </div>
                </div>
            <?php
            }
        }

    Then paste that inside the file functions.php just before the closing php tag at the end.

    before this last line
    ?>

    Then do you changes inside this code that was pasted in functions.php

    Let me know if you still have doubts.

    -Rui

    #218656
    MarcusRG
    Member
    Post count: 69

    Still doubts. I pasted the code into functions.php

    I will fix the differences between the php files and keep you updated. I’ll let you know if this will kill me.

    #218661
    MarcusRG
    Member
    Post count: 69

    Still can’t get it to work.

    I don’t know which changes I am supposed to make in the code you gave me to paste in functions.php.

    When I update my child theme for example product-archive.php (the part about the removed code) it still just removes my H1 and breadcrumbs.

    So I’m still really confused to how I’m supposed to fix the asset heading (width problem) on archive page and get my H1 and breadcrumbs back on single product pages.

    #218767
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Can you provide ftp access to have a look of what is done?
    Use the private reply.

    -Rui

    #218859
    MarcusRG
    Member
    Post count: 69

    I have reversed the changes now, because there was no difference.

    It’s still just the page heading that’s broken.

    Only change now is the code you gave me, that I inserted into the functions.php in my child theme.

    #218861
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Will need the ftp to look at the files content.

    -Rui

    #218914
    MarcusRG
    Member
    Post count: 69

    Had someone from Codeable to fix it.

    Though now I get this

    Should I worry?

    Translates to:This theme is broken and can not be used. Template is missing.

    Attachments:
    You must be logged in to view attached files.
    #218928
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    It seems it’s missing the style.css from the child theme.
    You should ask to the Codeable guy to fix what might is wrong now.

    -Rui

Viewing 10 posts - 31 through 40 (of 40 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register