[Resolved] Displaying Posts Navigation on CPT's

Home Forums Support Displaying Posts Navigation on CPT's

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #466273
    Roverd

    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?

    GeneratePress 2.0.1
    GP Premium 1.5.6
    #466321
    Tom
    Lead Developer
    Lead Developer

    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 🙂

    #467344
    Roverd

    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.

    #467787
    Tom
    Lead Developer
    Lead Developer

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

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

    #468748
    Roverd

    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.

    #468911
    Tom
    Lead Developer
    Lead Developer

    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!

    #468966
    Roverd

    Sure! Thanks Tom.

    #469377
    Tom
    Lead Developer
    Lead Developer
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.