Site logo

Archived topic

Move & Edit Page Navigation

13 replies · Started by Hannah on October 31, 2019

Viewing posts 1–14 of 14

good morning!!

i've been trying to move my page navigation to be inside of the post, itself, so it's between the post and the comment box. i did a little digging through previous forum questions and found advice to use this code:

add_filter( 'generate_category_post_navigation','generate_force_category_post_navigation' );
function generate_force_category_post_navigation()
{
    return true;
}

but that was a post from 2016 and i can only imagine that generatepress has gone through some updates since then. i've checked all the available menus in the customize theme section and have tried using the above code through Snippets and Pluginception but haven't had any luck so far.

i'd also like to replace the whole bar with a simple image that has "first post", "previous post", "next post" and "latest post" options if possible. any advice or tips would be much appreciated!

thank you! (and happy halloween!)

Hi there,

Try this PHP:

add_action( 'generate_before_comments', function() {
    if ( is_single() ) {
        generate_content_nav( 'nav-below' );
    }
} );

Then add this CSS:

.post + .paging-navigation {
    display: none;
}

Let me know :)

afternoon!

okay, it looks like that has removed the page-navigation! i see that the codes direct the nav to 'before comments' and no display.

is there a certain place in the theme customization window or the CSS coding that i would go to set up the navigation image? i'm hoping set up 4 'images' that would serve as "first page", "previous page", "next page" and "newest page" buttons respectively.

thanks!

Where would those images come from, exactly? It may be possible, but it would likely involve a decent amount of coding, unfortunately.

Let me know :)

i'd (hopefully) be uploading them through the wordpress media tool but if that doesn't work, i'd be using imgur. my site is going to host my upcoming webcomic and i wanted to use a page navigation like most webcomics do (click here for example) where the nav is directly below the page and there are four options!

if that's not something easily pulled off, just let me know! :)

The first and last page part is the difficult part.

Right now it doesn't look like pagination is showing up at all using my solution above. That might be because you're using a custom comments system.. Can you try turning on the default comments to see if the pagination shows up?

ah, dangit. i thought that it not showing up was kind of what we were going for, haha. it's not visible on my end either.

i'm kind of nervous to deactivate the custom comments because i just finished working with wpdiscuz to de-bug some problems we were having with them and i don't know if deactivating them, even for a moment, will revert whatever changes their development team made to it. Dx> does the plug-in totally reset if you deactivate it?

It shouldn't, but I'm not sure what they did to fix those issues, so maybe it's not a good idea.

Can you try replacing generate_before_comments with generate_after_content in the code I gave you?

Let me know :)

it doesn't appear to have worked that way, either. my code is now:

add_action( 'generate_after_content', function() {
    if ( is_single() ) {
        generate_content_nav( 'nav-below' );
    }
} );

not sure if i needed to change the 3rd line of code at all, either. but swapping those two doesn't seem to have made a difference, i'm sorry!

Weird, I guess Elementor is taking over the entire page, which is removing our hooks.

What about this?:

add_action( 'generate_after_entry_content', function() {
    if ( is_single() ) {
        generate_content_nav( 'nav-below' );
    }
} );

If that doesn't work, you might need to build your paging navigation inside Elementor itself, since the rest of the page is built using it. Not sure if they have that option?

okay, that doesn't seem to have worked, either. i think elementor DOES have a page nav, though, i'm pretty sure, so maybe i can toy around with that. :)

FINAL QUESTION: is there a code i could use to 'permanently' hide generatepress's built in page navigation so it doesn't suddenly pop up at the bottom? or should i just keep using these codes since they seem to 'turn it off' or hide it?

thank you so much for your help, tom, i seriously appreciate it.

Definitely, give this a shot:

add_filter( 'generate_show_post_navigation', '__return_false' );

Let me know :)

perfect!! :D thank you so much, tom!

You're welcome :)

This archived topic is closed to new replies.