Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].
I’m using the post loop widget, but there’s no pagination. I tried changing templates and inserting the pagination code in a templet, but found the POST LOOP TEMPLATE is the format of one post, so it inserts the pagination under each excerpt. NOT what we want. It should be after the entire loop ends.
Is there a widget or shortcode to put it underneath the post loop?
Ideally, this should actually be an option in the widget itself: _ SHOW PAGINATION
Thank you.
I found where the code should go:
/wp-content/plugins/siteorigin-panels/inc/widgets/post-loop.php
line 205 after: echo $args[‘after_widget’];
[INSERT PAGINATION HERE]
I have temporarily put our code’s pagination code there, but it will be overwritten with your next release. At least put a hook there???
Hi Jennifer
Thanks for reaching out.
If you’re using a child theme or a custom plugin, it should be relatively quick to copy your theme loop and create a custom template. Here is an example of a loop template with pagination:
https://github.com/siteorigin/siteorigin-corp/blob/develop/loops/loop-blog-standard.php
More on adding a custom template to your child theme or plugin at the following URL:
Page: Post Loop Widget
Hopefully, that helps.
Since we’re putting this widget on a PAGE, it’s using the page template – which then hosts your widget, which then calls the “loop”.
The theme loop file only has the internal HTML for each post. It’s your widget and your code that’s running it.
Here’s our LOOP FILE which we did copy to our child theme. As you can see it’s just the internal part of the loop. If we put PAGINATION in this template it will show under every article excerpt. So that is not a solution.
Thanks for your reply.
You can create a custom loop template with pagination and then select that template in the Post Loop widget.
If you aren’t already using a child theme, you can find a child theme for Virtue here.
Copy
page-blog.php
from the parent theme and insert the file into your child theme. Renamepage-blog.php
toloop-blog.php
. Once that’s done you’ll be able to selectloop-blog.php
within the Post Loop widget.If you’re installing a child theme late in the site’s development, see our guide on migrating Customizer settings from the parent to the child theme Post: Migrating Parent to Child Theme Customizer Settings.
It’s possible to name your post loop template as required. You can also go the route of adding this new template via a plugin. More info on that here Page: Post Loop Widget.
I’m using a child theme.
Sounds good, let us know how it goes.
That didn’t work – it broke the layout.
It showed full posts, then a post loop under it, then the divs were all off. Why can’t you just take the note and put the PAGINATION in your widget? Obviously from all the posts about this, it’s a necessary addition.
The Post Loop widget looks for the following patterns:
The reason there are requests to add pagination is because many themes don’t have appropriately named loop files so only the content partials show up in the available template list. Content partials are used within a typical loop/index/archive file meaning they don’t have pagination. The issue is not with the widget, the widget wasn’t designed to build a template, it’s a lightweight option designed to build a query, in this case, it’s the theme’s job to provide a compatible template. If you’d like to see an example of this, fully functional, try our SiteOrigin Corp theme in a demo install on your local or live server. Example Post Loop page https://demo.siteorigin.com/corp/standard-blog-layout/.
Here is an example using a Virtue child theme: https://demo.siteorigin.com/static-demo-page/. The page template being used in this demo is the “Default” Virtue page template selected in the right column when editing the page.
Here is a copy of the child theme being used at the above link.
https://siteorigin.com/wp-content/uploads/2020/06/virtue_child.zip
Here is an updated child theme you can try out/experiment with:
https://siteorigin.com/wp-content/uploads/2020/06/virtue_child_02.zip
The updated child theme simplifies and improves upon the first child theme. You can see the work done in the child theme in the loop-blog.php file and the style.css file. When selecting the template in the Post Loop widget, the name is “Blog” when using this child theme.
This is more than we’re usually able to offer within our free support scope due to budget limitations, hopefully this second child theme helps.
We’ve begun work on a Blog widget which would have been the ideal solution for what you’re trying to do. We should have that released into the Widgets Bundle in the next few months.