[Resolved] Move & Edit Page Navigation

Home Forums Support Move & Edit Page Navigation

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1049501
    Hannah

    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!)

    #1049854
    Tom
    Lead Developer
    Lead Developer

    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 🙂

    #1050049
    Hannah

    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!

    #1050200
    Tom
    Lead Developer
    Lead Developer

    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 🙂

    #1050390
    Hannah

    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! 🙂

    #1050677
    Tom
    Lead Developer
    Lead Developer

    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?

    #1050740
    Hannah

    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?

    #1051090
    Tom
    Lead Developer
    Lead Developer

    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 🙂

    #1051194
    Hannah

    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!

    #1051666
    Tom
    Lead Developer
    Lead Developer

    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?

    #1051863
    Hannah

    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.

    #1052146
    Tom
    Lead Developer
    Lead Developer

    Definitely, give this a shot:

    add_filter( 'generate_show_post_navigation', '__return_false' );

    Let me know 🙂

    #1052180
    Hannah

    perfect!! 😀 thank you so much, tom!

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