简体   繁体   中英

Yoast breadcrumb plugin showing 1

I am using the Yoast SEO Wordpress plugin and am implementing breadcrumbs on my site for some reason I have 2 issues I cannot seem to resolve.

  1. After adding the following code a number '1' shows up and I cannot get rid of it... See http://alanbrandt.com/portfolio/

  2. All pages have the same post name part from the posts root site? Why does it always show the same post title on all pages? (Home > Portfolio > Daydreaming…)

Here is the code:

<div class="breadcrumbs">
    <?php 
    if ( function_exists('yoast_breadcrumb') ) {
        $breadcrumbs = yoast_breadcrumb('<p class="breadcrumbs_p">','</p>');
        echo $breadcrumbs;
    } 
    ?>
    </div>
    <div class="clearfix"></div>

Hope some one can help!

Thanks! :)

From the source

/**
  * Template tag for breadcrumbs.
  *
  * @param string $before  What to show before the breadcrum
  * @param string $after   What to show after the breadcrumb.
  * @param bool   $display Whether to display the breadcrumb (true) or return it (false).
  * @return string
  */

You want to do:

$breadcrumbs = yoast_breadcrumb('<p class="breadcrumbs_p">','</p>', false);

or do the following and not echo.

yoast_breadcrumb('<p class="breadcrumbs_p">','</p>');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM