Site logo

Archived topic

Add previous / next links to CPT single posts - found support topic 2017

7 replies · Started by Brad on February 24, 2022

Viewing posts 1–8 of 8

There's probably an efficient way to do this via GenerateBlocks - New Element - Block (? For a function / echo line of php)- Hook
Display on CPT

This isn't working. it's amended from the 2017 post which dragged out to 2020.

Note: I'm using GenerateBlocks the replace the Content Template of the archive CPT pages. Not sure if that screws things up. It's just content thrown in after one hook, yes?

add_action( 'generate_after_entry_content', 'j66co_cpt_showcase_post_nav' );
function j66co_cpt_showcase_post_nav() {
if ( 'showcase' == get_post_type() ) : ?>
<footer class="entry-meta">
<?php generate_entry_meta(); ?>
<?php if ( is_single() ) generate_content_nav( 'nav-below' ); ?>
</footer><!-- .entry-meta -->
<?php endif;
}

add_action( 'generate_after_entry_content', 'j66co_cpt_photography_post_nav' );
function j66co_cpt_photography_post_nav() {
if ( 'showcase' == get_post_type() ) : ?>
<footer class="entry-meta">
<?php generate_entry_meta(); ?>
<?php if ( is_single() ) generate_content_nav( 'nav-below' ); ?>
</footer><!-- .entry-meta -->
<?php endif;
}

https://generatepress.com/forums/topic/nextprevious-post-links-on-cpt/

Glad you figured it out :)

Sincere thanks! Perfect tutorial. Just used a template for now to get it working.

Idea. Not sure if there’s a tutorial section on support within search but that my help everyone out. Maybe filter select options one could check? You guys have over a decade of support post though so I’m not sure if something like facet Wp and searchwp would be hard to implement.

https://facetwp.com/

https://searchwp.com/

There have been attempts to implement these and I think they had some level of success.

I believe it's just a matter of knowing what function renders the toggles and filters and hooking them in through GP specific hooks.

But as for the specifics, it may require asking their developers on what to use.

This archived topic is closed to new replies.