[Resolved] Hide Breadcrumbs

Home Forums Support [Resolved] Hide Breadcrumbs

Home Forums Support Hide Breadcrumbs

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #433167
    Sebastián

    Hi I put this code in the header.php file:

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

    And i enabled the breadcrumbs by Yoast.

    But the only reason I want the breadcrumbs is for google searches.

    Is there a way to hide the actual breadcrumbs from the pages? I don’t want them to appear.
    Just did it for Google Search.

    Thanks

    #433271
    Leo
    Staff
    Customer Support

    Hi there,

    Try this:

    <?php if ( function_exists('yoast_breadcrumb') && ! is_page() && ! is_home() ) : ?>
        <?php yoast_breadcrumb( '<p id="breadcrumbs">','</p>' ); ?>
    <?php endif; ?>
    #433672
    Sebastián

    So I need to put that code instead of the other one?

    #433699
    Leo
    Staff
    Customer Support

    Yes

    #433702
    Sebastián

    The breadcrumbs still appear on the blog page and blog posts.

    And I already choose “hide on blog page” in the yoast advanced menu.

    #433770
    Leo
    Staff
    Customer Support

    The condition I gave you is only to exclude pages?

    If we hide on pages, main blog page, and posts, where is it supposed to show?

    #433995
    Sebastián

    I would like to display breadcrumbs on the single blog posts down the featured images at the start of the posts. But not here: https://i.imgur.com/xDwxMb4.png

    Thanks!

    #434096
    Leo
    Staff
    Customer Support

    Then maybe the After Entry Title hook? http://demo.generatepress.com/hook-locations/

    #434109
    Sebastián

    Ok I put it in the Before Content Hook. Is there a code to center it? https://www.mmarketingonline.com/factores-claves-marketing-digital/

    #434138
    Leo
    Staff
    Customer Support

    Had to wrong quotation before. Fixed it above: https://generatepress.com/forums/topic/hide-breadcrumbs/#post-433271

    Then you can use this CSS to center it:

    #breadcrumbs {
        text-align: center;
    }
    #434147
    Sebastián

    Great now I have it the way I wanted it!

    But can I hide breadcrumbs on the blog page? https://i.imgur.com/HEbQjul.png
    https://www.mmarketingonline.com/blog/

    #434189
    Sebastián

    Another thing, code to reduce the margin between the featured image and the post title in the blog page? https://i.imgur.com/vFKi7BG.png

    #434271
    Leo
    Staff
    Customer Support

    Adjusted the code above to exclude blog page: https://generatepress.com/forums/topic/hide-breadcrumbs/#post-433271

    This should work for the margin:

    .post-image-above-header .inside-article .post-image {
        margin-bottom: 1em;
    }
    #439106
    Sebastián

    Breadcrumbs are working so everything is good but…

    Why they are not displaying the blog category and how to do it? https://i.imgur.com/wbIlz3F.png

    They are also not displaying the title of the web they are displaying the url

    Looks like this: URL – Blog

    But I want: Web Title (MMarketingOnline) – Blog – Category

    Hope I made myself clear.

    Thanks!

    #439157
    Leo
    Staff
    Customer Support

    You’d have to check with where the breadcrumb code came from. GP hooks simply displays the content and does not alter the structure.

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.