This topic has 7 replies, 2 voices, and was last updated 9 years by sharmstr.

  • Author

    Tagged: ,

  • #56453
     ITEXPERIENCE
    Participant

    Hi

    Im writing you to inquire about the feasibility of displaying breadcrumbs under the title in the MAIN SECTION.
    This feature would be useful in the category pages as well.
    I have already set the title in main section but the breadcrumbs are not displayed yet.
    Please find attached a screenshot to see an example.

    Thanks in advance for your support.

    Regards

    ITEXPERIENCE

    Attachments:
    You must be logged in to view attached files.
    #56455
     ITEXPERIENCE
    Participant
    #56456
     ITEXPERIENCE
    Participant

    Sorry but I’d like to add that the breadcrumbs display would be needed in the “product category’s pages” and in “single product’s pages” as well.

    Thanks

    ITEXPERIENCE

    #56462
     sharmstr
    Moderator

    I’m hesitant to give you this code because I think it will open up a huge discussion about how to tweak the code to give you exactly what you want, which is a bit out of scope for help here. So, I’m going to give you this with the caveat that you’ll have to sort out styling, placement and other issues on your own.

    Turn off breadcrumbs in theme options and try this in your functions.php file.

    COPY CODE
    
    function kleo_title_main_content() {
    		if (sq_option('title_location', 'breadcrumb') == 'main') {
    			
    			$title_status = true;
    			if( is_singular() && get_cfield( 'title_checkbox' ) == 1 ) {
    				$title_status = false;
    			}
    
    			if ( $title_status ) {
    				echo '<div class="container">';
    				echo '<h1 class="page-title">' . kleo_title() . '</h1>';
    				echo '</div>';
    			}
    			
    			echo kleo_breadcrumb(array(
                    'show_browse' => false,
                    'separator' => ' ',
                    'show_home'  => __( 'Home', 'kleo_framework' ),
                    'echo'       => false
                ));
    			
    		}
    	}
    
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #56464
     ITEXPERIENCE
    Participant

    Thanks for the advice but the code doesn’t work.
    I put it in the function.php and i turn-off the breadcrumbs in the theme option.
    Is there other suggestion you can give me, please?

    Regards

    ITEXPERIENCE

    #56468
     sharmstr
    Moderator

    Add this below the function I gave you

    COPY CODE
    
    add_filter('woocommerce_show_page_title',  'kleo_title_main_content');
    

    Not sure how to get it to show up on the single product page though.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #56485
     ITEXPERIENCE
    Participant

    I want to thank you meanwhile, but can you explain me the reason why the approach is different between the two pages.

    I keep looking for this solution and I really appreciate your effort.

    Thanks a lot.

    ITEXPERIENCE

    #56515
     sharmstr
    Moderator

    I dont know.

    Anyhow, I played around with more code and I think this might be a better solution and it adds it to the single product page as well.

    COPY CODE
    
    function kleo_title_main_content_woo() {
    		if (sq_option('title_location', 'breadcrumb') == 'main') {
    			
    			$title_status = true;
    			if( is_singular() && get_cfield( 'title_checkbox' ) == 1 ) {
    				$title_status = false;
    			}
     
    			if ( $title_status ) {
    				echo '<div class="container">';
    				echo '<h1 class="page-title">' . kleo_title() . '</h1>';
    				echo '</div>';
    			}
    			
    			echo kleo_breadcrumb(array(
                    'show_browse' => false,
                    'separator' => ' ',
                    'show_home'  => __( 'Home', 'kleo_framework' ),
                    'echo'       => false
                ));
    			
    		}
    	}
    	
    add_filter('woocommerce_show_page_title',  'kleo_title_main_content_woo');
    add_action( 'woocommerce_before_single_product',  'kleo_title_main_content_woo' );
    
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?