Premium support

Please log in to post in these forums. If you didn't create an account when you purchased, please contact us.

Free support

If you haven't purchased GP Premium, support for the free theme can be found on WordPress.org.

[Resolved] Adding Breadcrumbs to GP

Home Forums Support Adding Breadcrumbs to GP

This topic contains 13 replies, has 3 voices, and was last updated by  Leo 6 days, 15 hours ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #485350

    Good morning Tom,

    I have been reading through quite a few posts related to getting breadcrumbs on a GP site but it seems a little overwhelming as I do not know PHP and am fearful I will make a mistake.

    It seems most references are made to the Yoast plugin which is what I use as well so that part is good.

    I’ve seen some posts where the suggestion is to add some php code and others stating to add in the hooks section (I’ve most likely got the naming wrong apologies)

    I’ve also seen comments like disable execution of php (I think that was it) and another stating to make sure execute PHP was checked.

    Nonetheless what I would like to achieve is having breadcrumbs on my posts and pages (except home page) for a complete newbie who knows absolutely nothing about php code etc. what would you suggest as the easiest method for me to accomplish this?

    I appreciate your feedback and support. Thanks as always.

    GeneratePress 2.0.2
    GP Premium 1.5.6
    #485583

    Leo
    Staff

    Hi there,

    Yoast SEO would be the best option.

    You can add it in using similar code here: https://generatepress.com/forums/topic/yoast-breadcrumbs-styling/#post-467121

    Let me know if you need more info 🙂

    Want to help support GP? Please consider leaving us a review!
    https://wordpress.org/support/theme/generatepress/reviews

    #488705

    Hi Leo I think this has worked itself out I need to do a few edits and double check prior to marking resolved. Thanks. This has lead me to two more questions but they’re not breadcrumb related so I will open a new thread on those topics:

    Single Post Image Size
    Meta Data

    thanks.

    James

    #488908

    Leo
    Staff

    No problem 🙂

    Sounds good!

    Want to help support GP? Please consider leaving us a review!
    https://wordpress.org/support/theme/generatepress/reviews

    #489107

    Leo it worked nicely thank you however it is also showing on all my pages and I’m hoping to only show the breadcrumbs on blog post pages is there something in the code I would need to add/change?

    Thanks.

    James

    #489535

    Leo
    Staff

    Try this:

    <?php if ( function_exists('yoast_breadcrumb') && is_single() ) : ?>
        <div class="grid-container yoast-breadcrumb">
            <?php yoast_breadcrumb( '<p id="breadcrumbs">','</p>' ); ?>
        </div>
    <?php endif; ?>

    Want to help support GP? Please consider leaving us a review!
    https://wordpress.org/support/theme/generatepress/reviews

    #489592

    This worked fantastically!!!

    All pages including Home Page are no longer showing the breadcrumbs

    HOWEVER

    On my Blog main page they are still showing is there one more snippet I can add in that will remove it from the main blog page as well?

    AND

    I now have lost the breadcrumbs on the single blog posts themselves which is where I was hoping to have them appear?

    JP

    #489680

    Leo
    Staff

    The code I had before makes them ONLY show on blog page.

    Just edited so they should ONLY show on single posts.

    Want to help support GP? Please consider leaving us a review!
    https://wordpress.org/support/theme/generatepress/reviews

    #492535

    Thanks Leo so the correct code to have the breadcrumbs only appear on single post pages is as you noted above and I’m copied below?

    <?php if ( function_exists(‘yoast_breadcrumb’) && is_single() ) : ?>

    <?php yoast_breadcrumb( ‘<p id=”breadcrumbs”>’,'</p>’ ); ?>

    <?php endif; ?>

    #492643

    Leo
    Staff

    Yup the exact code here: https://generatepress.com/forums/topic/adding-breadcrumbs-to-gp/#post-489535

    Want to help support GP? Please consider leaving us a review!
    https://wordpress.org/support/theme/generatepress/reviews

    #495051

    Kim

    Hi Leo

    I read this post with interest. Is there a code to just leave it out of the front page only?

    Thanks

    #495415

    Leo
    Staff

    Try this:

    <?php if ( function_exists('yoast_breadcrumb') && ! is_front_page() ) : ?>
        <div class="grid-container yoast-breadcrumb">
            <?php yoast_breadcrumb( '<p id="breadcrumbs">','</p>' ); ?>
        </div>
    <?php endif; ?>

    More info here if you are interested: https://docs.generatepress.com/article/using-hooks-conditional-tags/

    Want to help support GP? Please consider leaving us a review!
    https://wordpress.org/support/theme/generatepress/reviews

    #495875

    Kim

    Worked like a charm! Thank you very much 🙂

    #496075

    Leo
    Staff

    No problem 🙂

    Want to help support GP? Please consider leaving us a review!
    https://wordpress.org/support/theme/generatepress/reviews

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

You must be logged in to reply to this topic.