[Support request] How to create Hook for Yoast SEO breadcrumbs

Home Forums Support [Support request] How to create Hook for Yoast SEO breadcrumbs

Home Forums Support How to create Hook for Yoast SEO breadcrumbs

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #407447
    Zohaib

    Hi Tom,

    I have used Yoast Seo script to generate breadcrumbs by adding the code to the singlepage.php file. However, I do not want them to appear on the homepage as it is showing right now. Here is the link to the website https://www.superbeyebrows.co.uk. I have noticed someone else mentioned that we can use manual hooks to add the breadcrumb script but I do not know to add this. Please, can you help me with this?

    #407561
    Leo
    Staff
    Customer Support

    Hi there,

    Yup you can use GP hook:
    https://docs.generatepress.com/article/hooks-overview/
    http://demo.generatepress.com/hook-locations/

    With conditional tag like this to exclude home page:

    <?php if ( ! is_front_page() ) : ?>
        code here
    <?php endif; ?>

    And make sure execute PHP is checked.

    #407631
    Zohaib

    Hi Leo,

    Thanks for getting back to me.

    I have implemented below code and it is working fine. However, on the blog page, breadcrumbs appear with every single post. I want the breadcrumb to appear only once on the top. Can you help me resolve this issue.

    Thanks

    Zo

    #407633
    Zohaib

    Here is the code:

    <?php if ( ! is_front_page() ) : ?>
       <?php if ( function_exists('yoast_breadcrumb') ) { ?>
    	<div class="grid-container grid-parent">
    		<div class="page-header">
    			<?php yoast_breadcrumb('<p id="breadcrumbs">','</p>'); ?>
    	
    		</div>
    	</div>
    <?php } ?>
    <?php endif; ?>
    #407688
    Leo
    Staff
    Customer Support

    Where are you adding the code?

    #407689
    Zohaib

    I have implemented the code on below header hook.

    Thanks

    #407708
    Leo
    Staff
    Customer Support

    In after header hook?

    Any reason you added the page header class div?

    #696981
    Karsten

    Could you please check and help me to implement breadcrumbs correctly?

    Currently I only see the structure of Breadcrumbs on the left border.

    Breadcrumbs not visible

    Thank you

    Karsten

    #696987
    David
    Staff
    Customer Support

    Hi there,

    we can cover this on your own topic. Thanks

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