- This topic has 13 replies, 2 voices, and was last updated 4 years, 5 months ago by Tom.
-
AuthorPosts
-
October 31, 2019 at 5:14 am #1049501Hannah
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!)
October 31, 2019 at 10:06 am #1049854TomLead DeveloperLead DeveloperHi 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 π
October 31, 2019 at 2:59 pm #1050049Hannahafternoon!
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!
October 31, 2019 at 8:53 pm #1050200TomLead DeveloperLead DeveloperWhere would those images come from, exactly? It may be possible, but it would likely involve a decent amount of coding, unfortunately.
Let me know π
November 1, 2019 at 5:08 am #1050390Hannahi’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! π
November 1, 2019 at 9:46 am #1050677TomLead DeveloperLead DeveloperThe 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?
November 1, 2019 at 10:57 am #1050740Hannahah, 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?
November 2, 2019 at 12:36 am #1051090TomLead DeveloperLead DeveloperIt 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
withgenerate_after_content
in the code I gave you?Let me know π
November 2, 2019 at 6:03 am #1051194Hannahit 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!
November 2, 2019 at 7:47 pm #1051666TomLead DeveloperLead DeveloperWeird, 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?
November 3, 2019 at 5:29 am #1051863Hannahokay, 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.
November 3, 2019 at 9:39 am #1052146TomLead DeveloperLead DeveloperDefinitely, give this a shot:
add_filter( 'generate_show_post_navigation', '__return_false' );
Let me know π
November 3, 2019 at 9:57 am #1052180Hannahperfect!! π thank you so much, tom!
November 3, 2019 at 10:07 am #1052195TomLead DeveloperLead DeveloperYou’re welcome π
-
AuthorPosts
- You must be logged in to reply to this topic.