• Resolved schastnyy

    (@schastnyy)


    Here is a link to my website https://visa2usa.com.ua

    I tried to add breadcrumbs by Yoast into my site using child theme.
    On my local copy I add required strings in page.php and single.php – everithing works fine.

    Than I copied those files to my main site child theme folder (linked in the beginning) and Breadcrumbs are not showing on Full Width Page Template.
    Right Sidebar and Post page types are right.

    What can be the problem while on my local copy of this site everything works fine on all page templates.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author Shaped Pixels

    (@shaped-pixels)

    Hi schastnyy…sorry for late response.
    If I understand this correctly, a page using the Full Width Page Template is not showing the breadcrumbs, but the others do?

    In your copied Full Width template file (in the child theme), put your breadcrumbs after this container:

    <div class="col-md-12">

    See if that works?

    Also, I just want to make sure that when you copied over the templates into your child theme, are they also in a folder “page-templates” as well?

    Thread Starter schastnyy

    (@schastnyy)

    Hi Andre.

    No, I haven’t added a folder “page-templates” into my child theme yet. Instead of this fact, take a look at the following files:

    single.php

    <?php
    /**
     * The template for displaying all single posts.
     *
     * @package Emphasize
     */
    
    get_header(); ?>
    
    <div id="primary" class="content-area">
    
    <div class="container">
    <?php if ( function_exists( 'yoast_breadcrumb' ) ) {
    	yoast_breadcrumb();
    } ?>
    </div>
    
        <main id="main" class="site-main" role="main">
    
    		<?php $singlestyle = get_theme_mod( 'single_layout', 'singleright' );
    
                switch ($singlestyle) {
    
                    // Single Right Sidebar
                    case "singleright" :
    
                        echo '<div class="container"><div class="row"><div class="col-md-8">';
                            get_template_part( 'loop' );
                        echo '</div><div class="col-md-4">';
                            get_sidebar( 'right' );
                        echo '</div></div></div>';
                    break;		
    
                    // Single Left Sidebar
                    case "singleleft" :
                        echo '<div class="container"><div class="row"><div class="col-md-8 col-md-push-4">';
                            get_template_part( 'loop' );
                        echo '</div><div class="col-md-4 col-md-pull-8">';
                            get_sidebar( 'left' );
                        echo '</div></div></div>';
                    break;							
    
                    // Single - no sidebars
                    case "singlewide" :
                        echo '<div class="container"><div class="row"><div class="col-md-12">';
                            get_template_part( 'loop' );
                        echo '</div></div></div>';
                    break;           
    
                    }
            ?>
    
        </main>
    </div>
    
    <?php get_footer(); ?>

    page.php

    <?php
    /**
     * The template for displaying all pages.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @package Emphasize
     */
    
    get_header(); ?>
    
    <div id="primary" class="content-area">
        <main id="main" class="site-main" role="main">
            <div class="container">
    		<?php if ( function_exists( 'yoast_breadcrumb' ) ) {
    	yoast_breadcrumb();
    } ?>
                <div class="row">
    
                    <div class="col-md-8">
                        <?php get_template_part( 'loop' ); ?>
                    </div>    
    
                    <div class="col-md-4">
                    	<?php get_sidebar( 'right' ); ?>
                    </div> 
    
                </div>
            </div>
        </main>
    </div>
    <?php get_footer(); ?>

    They are located in the child theme folder and seems to work fine on a test site, but not on the public one.

    So, what other changes do I need to perform?

    Theme Author Shaped Pixels

    (@shaped-pixels)

    Ah…For the single.php and page.php files, where you have them is correct. However, for the full-width.php template (the full width one), this needs to match the location it exists in the parent theme. So for that one, you need to create a folder in your child theme as:

    page-templates

    Then inside that folder you can put the “full-width.php” template file….providing you added the breadcrumbs code to that one.

    Thread Starter schastnyy

    (@schastnyy)

    Hi Andre,

    Sorry for a late reply.

    It works now, thanks for your help.

    Evgen

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Yoast Breadcrumbs’ is closed to new replies.