Site logo

Archived topic

Displaying Posts Navigation on CPT's

7 replies · Started by Satori on January 8, 2018

Viewing posts 1–8 of 8

Right now I'm using Pods to create and manage CPT's, anyway, I've noticed the entries for this customs don't display the default posts nav. Either the category and tags. Any idea how can I fix this?

Hi there,

Try this:

add_action( 'generate_after_entry_content', 'tu_cpt_footer_meta' );
function tu_cpt_footer_meta() {
    if ( is_singular( 'your-post-type' ) ) : ?>
        <footer class="entry-meta">
            <?php generate_entry_meta(); ?>
            <?php generate_content_nav( 'nav-below' ); ?>
        </footer><!-- .entry-meta -->
    <?php endif;
}

Just update the name of your CPT there.

Let me know :)

Hi Tom! The code does not seem to work. I'm using a child theme, so I'm adding the code in the functions.php file. My post type is called "resena", but still the posts nav doesn't show up. I purged the cache on my site using WP Rocket but still the same.

Hmm weird, I'm not even seeing the <footer> markup on your page.

To confirm, this is your conditional? is_singular( 'resena' )

Hi Tom! I don't have the footer activated as I'm using one created via Elementor. Anyway the problem seems to be solved now. I read today a plugin called Imagify (which I have installed on this site) was causing issues at php level. Maybe iy was the source of the conflict, as bassically didn't do anything else yesterday, just leave it as it is, and today when I logged in, the meta was displaying on the custom post type.

The site I'm working on is one of movies' reviews. I have two CPT's, one called Critica and one Resena. Want to know how do I add the critica post type, should be something like this?

is_singular( 'resena' 'critica' )

Also, I wasn't consider it before. But I have to use a custom taxonomy called "Genres" to classify the genre of the movie or serie: Sci-Fi, Horror, Thriller, etc. How do I include a custom taxonomy to show just like the default categories on the nav meta.

You would do this:

is_singular( array( 'resena', 'critica' ) )

Any chance you can open a new topic about the taxonomies? I think it would be helpful for others to find easily :)

Thanks!

Sure! Thanks Tom.

No problem :)

This archived topic is closed to new replies.