- This topic has 7 replies, 2 voices, and was last updated 5 years, 7 months ago by Tom.
November 15, 2015 at 6:12 am #153208theonetruevlad
I am using a PHP insertion plugin to show posts in a certain category on a certain page.
I have the page with some blurb about the category and it then shows the last 3 blog post from that category underneath.
What I want is the pagination links to appear at the bottom of the page because that is where people will be after scrolling through the posts. Unfortunately they appear at the top before the posts.
There is an extra empty section showing at the bottom of the page. Maybe this has to do with the generatepress theme option for sections?
$page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=33&showposts=3&paged=$page"); posts_nav_link();November 15, 2015 at 10:41 am #153239TomLead DeveloperLead Developer
Hard for me to know what’s going on really.
Have you tried this plugin?: https://wordpress.org/plugins/display-posts-shortcode/
It’s very well written and should do something similar to what you’re looking for.November 15, 2015 at 11:35 am #153263theonetruevlad
Sadly does not support pagination and does not show the whole post, only shows title with option for an excerpt.November 15, 2015 at 9:28 pm #153342TomLead DeveloperLead DeveloperNovember 29, 2015 at 9:33 am #156493theonetruevlad
Which just these 3 lines:
$page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=33&showposts=3&paged=$page"); posts_nav_link();
I have tried using both these plugins to insert the php:
If I add other content this also appears before the post. It seems to be that the actual posts go after all the content has been added regardless of where you place the post call.
Could I maybe stick the code in using gp hooks with conditions for which page I am on? Then I won’t need the extra plugins. Otherwise I guess I’ll have to research page templates.November 29, 2015 at 6:32 pm #156624TomLead DeveloperLead Developer
Hmm, nothing should be wrong with that code, but it all has to do with how and where you’re adding it.
Have you added it to a shortcode that you’re adding to the page? Or?November 30, 2015 at 11:54 am #156852theonetruevlad
Both plugins I have tried use shortcodes.
One you enter the code on the page between [insert_php] & [/insert_php] dropping the <?php & ?> Code goes where the & is.
The other plugin you add your php (again without the <?php & ?>) in the plugins optins page (the same way you do with custom css). Then you add the shortcode that references the code eg [xyz-ips snippet=”Pagination”]
Both plugins give the same result. You get all the text and the pagination buttons in the first section, then subsequent sections are posts and finally there is a blank section at the end. It is completely irrelevant which order you have the shortcodes and text on the page, it always publishes like this.December 1, 2015 at 11:52 pm #157201TomLead DeveloperLead Developer
Hmm, I’m afraid I don’t have any ideas on this one – I’m sorry!
Your best bet may be to create a custom page template so you have full control over the entire template.
- You must be logged in to reply to this topic.