Site logo

Archived topic

Portfolio Page Navigation Problem

5 replies · Started by Lina on January 13, 2023

Viewing posts 1–6 of 6

Hello,

I am working on some portfolio pages that were created with a custom post type, but I am having trouble with the navigation displayed on each individual portfolio page.

Problems:

- Each previous and next post appears with a double link
- Changing the overall look of the navigation links. I would like the navigation to look more prominent, perhaps with some arrows or icons, or something more visible.

Where can all this be changed?

Thank you!

Okay, I've followed the directions here to make the Previous and Next links appear on either side, which is what I wanted to accomplish - https://docs.generatepress.com/article/inline-post-navigation/

Would I be able to change the font and the arrow to a custom icon so that the navigation could look customized and more prominent?

Also, I still cannot figure out why the Previous and Next links are appearing doubled.

Hi there,

in your Code Snippets you have a snippet called: Custom Post Type Navigation

That code contains:

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

The generate_entry_meta(); function displays any meta for the post, which includes the generate_content_nav.
So you can remove this <?php generate_content_nav( 'nav-below' ); ?>

Alternatively you can remove that function entirely, and use Block Element to create the Post Navigation.

For example on the Scribe site from the site library:

https://gpsites.co/scribe/safely-planning-your-first-family-trip-abroad-in-years/

or Volume:

https://gpsites.co/volume/block-elements/

Let us know

Oh, yes! I would like the second option, of just creating a block element, because then it will be completely customizable, correct?

In that case, would I just remove the "Custom Post Type Navigation" snippet entirely and build the navigation in a block element?

Oh, it worked perfectly! Thank you very much, David. I will customize it however I want now.

Awesome - glad you got that working!!

This archived topic is closed to new replies.