Site logo

Archived topic

Help editing a hook for elements- no conditions

3 replies · Started by Derek on July 31, 2018

Viewing posts 1–4 of 4

Hi can someone help me re-write this php for elements since the conditional tags are not needed? I don't know how to write php code...I just copied this..I don't know what to delete or how to format it. Thank you!

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

Hi there,

You'd just need this:

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

Then you'd need to set the Display Rules as "Posts > All Posts".

That should do it :)

Noted! Thank you.

No problem :)

This archived topic is closed to new replies.