Pagination?
-
When using the loop tags, count = something, is it possible to do pagination? So I only want to display 3 but want to indicate that there are more than just the three.
-
Yeah, this same issue caught me up before:
“As of PHP 5.4 you can also use the short array syntax, which replaces array() with [].”
I’m so used to using [] in JavaScript to create arrays, that I sometimes use it in PHP also, forgetting that it’s a fairly new syntax there. It also is a good reminder to set up a test server with the minimum requirements of WordPress, i.e., PHP 5.2.4.
Yes..it’s been 7 months since your original request for pagination, and finally something is taking shape. I’m hoping to introduce more useful add-ons, so it’s good that the groundwork (website, plugin updater, etc.) is getting prepared.
Installed correctly
Activated correctly
Doesn’t seem to work, however.
I previously had the code working fine:
[loop type="product" taxonomy="product_cat" value="planning" orderby="rand" columns="3" pad="0px 10px" count="3"]Then I added paginate to it and nothing shows up at all. No error message, just a big blank.
[loop type="product" taxonomy="product_cat" value="planning" orderby="rand" columns="3" pad="0px 10px" count="3" paginate="true"]Content Paginator Version 0.1.2
Custom Content Shortcode Version 1.6.2
Wordpress Version 4.1Hmm, I believe it’s due to the columns parameter. I’ll test this and let you know when I figure something out.
OK, I’ve updated both CCS and Paginator. Now columns should work with pagination.
Also, I’ve improved the syntax. Before, it was necessary to wrap [loop] with [paginator], but now it works with or without.
[loop paginate="true"]will follow only the default settings of Paginator. To change its settings:[paginator center="true"] [loop ...] ... [/loop] [/paginator]In this syntax, you don’t have to specify paginate=”true” for the loop.
I’ve updated the documentation, so please have a look.
Okay so it’s kind of working?
Still using the following code:
[loop type="product" taxonomy="product_cat" value="planning" orderby="rand" columns="3" pad="0px 10px" count="3" paginate="true"]1. With columns, it’s not blank or anything, but it just shows up as if the pagination doesn’t exist. No navigator.
http://postimg.org/image/g6dlhfpi5/
[loop type="product" taxonomy="product_cat" value="planning" orderby="rand" pad="0px 10px" count="3" paginate="true"]2. Without columns. Shows 3 on the first page, and numbers up to page 6, but all pages except for 1 are blank (they show 3 bullets for li’s but there’s no content). I assume this has something to do with…
[loop type="product" taxonomy="product_cat" value="planning" orderby="rand" pad="0px 10px" paginate="true"]3. Without count. Now it shows 5, but the navigator works, so this is probably intended behaviour.
Anyways, it seems to be more or less working as intended, but not with columns.
1. With columns, each row is considered a page item. So, with 3 posts in 3 columns, there is only one row, and nothing to paginate.
2. This one is certainly not working as it should. If you have 3 posts, it shouldn’t show any pagination – default is 5 items per page. Do you have an example of this that I can look at?
I put together a test of columns & pagination here.
Since this thread is getting long, could we move our discussion to another thread, perhaps on the (very basic) forum for Paginator? I also want to test this feature. 🙂
Alright, moving to your forums.
In the newest plugin update, I added a more classic (no JavaScript) paging feature to the loop.
A basic example is:
[loop type="post" paged="5"] [field title] [/loop] [loopage]Please see the documentation for details.
The topic ‘Pagination?’ is closed to new replies.