• I would like to add breadcrumbs only on the Pages (not posts) on my website. The SEO plugin, Rank Math comes with breadcrumbs. It is working but I cannot get the breadcrumbs to show up at the exact location I would like to have it. I want the breadcrumbs to appear just above the Page title (at the same exact place where Categories appear on the Posts). Pages do not have categories and I want to use that area for breadcrumbs.

    After spending some time looking at all the files, I found the header/title text area in content-page.php. Original PHP code:

    <?php
    		// Page thumbnail and title.
    		twentyfourteen_post_thumbnail();
    		the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' );
    	?>

    I marked the place where I would like to breadcrumbs to show up as [breadcrumb_should_go_here] in the following code.

    	<?php
    		// Page thumbnail and title.
    		twentyfourteen_post_thumbnail();
    		the_title( '<header class="entry-header">[breadcrumb_should_go_here]
    <h1 class="entry-title">', '</h1></header><!-- .entry-header -->' );
    	?>

    This should ideally generate the breadcrumbs just above the Page title. But when I replace [breadcrumb_should_go_here] with the following, I get a PHP error.

    
    	<div class="entry-meta">
    			<span class="cat-links"><?php if (function_exists('breadcrumbs')) breadcrumbs(); ?></span>
    		</div>

    Note I am trying to use the default category CSS. May be a php expert here can advice me on how to add the breadcrumbs php function within the header function.

    Thank you for your advice.

    The page I need help with: [log in to see the link]

  • The topic ‘How do I add breadcrumbs function inside header class?’ is closed to new replies.