Site logo

Archived topic

Many breadcrumbs

21 replies · Started by Mizanur on September 29, 2014

Viewing posts 1–15 of 22

Hi Tom,
I am using breadcrumb by Yoast, as you have mentioned once here.

All are ok, except, now the breadcrumb (Home » Blog) is showing on the top of each blog entry. A screenshot here.

I want only once, top of the page only. Possible?

Mizan
[Oh, would like to see GeneratePress has its own breadcrumb implementation!]

Hi Mizan,

What hook are you adding the breadcrumb feature to?

I put the following code 'Before Content' hook.

<?php if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
} ?>

Before Content will show up before the content of everything - posts and pages (including excerpts).

You can add this in the "After Header" hook:

<div class="page-header grid-container grid-parent">
<?php if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
} ?>
</div>

If I put the code After Header hook the breadcrumb shows up all the way left.

My webpage LAYOUTt width is set to 1000px
It should be automatically aligned with layout length.

I tried with your code but it is giving me some extra characters! yoast_breadcrumb was fine.

The piece of code that makes sure it won't show up all the way to the left is this:

<div class="page-header grid-container grid-parent">
.... Yoast stuff in here
</div>

Not sure how it would be giving you extra characters? Maybe the formatting was off.

Try taking the above, and then replacing the .... Yoast stuff in here with the code provided by WordPress SEO.

1) I put the following code in After Header Hooks:

<div class="page-header grid-container grid-parent">
<?php if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
} ?>
</div>

Result: I got breadcrumb all the way left and some '); } ?> characters

2) I put the following code in After Header Hook:

<?php if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
} ?>

Result: I got breadcrumb all the way left. No special characters shown.

Just wondering why the breadcrumb is not aligning with the Layout!

Hi Tom,

I used github code it seems like the characters are gone! Sreenshot of hook

But the alignment issue still persists. Bangladesh Circle

I think today is Tuesday, nothing works on Tuesday. :)
Mizan

Yeap, the spell is broken! It works. :)
Thanks a million, Tom
Mizan

After so many comments and errors have been very confused. Also my level of knowledge is very basic, please indicate below could what code to be inserted and where to properly activate the breadcrumbs?

I think it would be good to have to install additional plug only if it can be inserted directly into the code, do not understand why you have not added that function to issue an update, like a button back to top

Hi there,

I agree! This is an option I'd like to add to an update in the future.

If you're using the Yoast SEO plugin, they have a breadcrumbs feature. If you enable that feature, you can paste the above code (https://gist.github.com/generatepress/14b3e8a93175f11d9545) into the "After Header" hook in "GP Hooks".

That will show the breadcrumbs.

Let me know if you need more info :)

I enabled the feature in Breadcrumbs Yoast SEO Plugin and I inserted the code in After Header Hooks, and this is what shows me where the breadcrumbs should appear:
','
'); } ?>

This archived topic is closed to new replies.