List pages shortcode not displaying in correct order
-
The intention is to list only five specific pages, out of several hundred published on my site, in a text widget, and to display the list in the sidebar on all pages. Following the instructions and examples in the List Pages Shortcode support page I created the following shortcode. It displays the correct five pages, with the dates included, but the order is confused. The one displaying fifth should be third, because it was the third published, chronologically. What have I done wrong, and how can I fix this?
[list-pages show_date="true" include="148281, 153768, 153686, 152921, 152719, 152544" sort_column="post_date"] -
Correction:
There are six pages. The one displaying sixth should be third. And those displaying 3rd, 4th, and 5th should each be advanced one place. -
I added a link to another page yesterday. The “Last Night When We Were Young” link, dated 21 March is still displaying out of order. It is listed last (seventh) when it should be third. All of the other links are displaying in chronological order.
-
Hi @musicdoc1, I’m thinking the list pages shortcode isn’t intended to set the pages in a specific order. But you can specify a “page number” for each of those pages if you’d like.
In the new editor, it’s under Page Options > Order. WP-admin has a similar setting though you may need to enable the box under screen options, so let me know if you need help finding it.
It doesn’t really matter what numbers you write, and I don’t believe they’ll show up anywhere in the theme. Just know that the first number needs to be lowest, and so on. Let me know if you need more help.
-
@supernovia,
Hi.I’m thinking the list pages shortcode isn’t intended to set the pages in a specific order.
It is intended to display them in specific order, according to the List Pages Shortcode support page, as I mentioned above. It says:
sort_column: sorts the list of Pages in a number of different ways. The default setting is sort alphabetically by Page title.
- ‘post_title’ – Sort Pages alphabetically by title (Default).
- ‘menu_order’ – Sort Pages by Page Order. Note the difference between Page Order and Page ID. The Page ID is a unique number assigned by WordPress to every post or page. The Page Order can be set by the user in the Pages -> Edit screen.
- ‘post_date’ – Sort by creation time.
- ‘post_modified’ – Sort by time last modified.
- ‘ID’ – Sort by numeric Page ID.
- ‘post_author’ – Sort by the Page author’s numeric ID.
- ‘post_name’ – Sort alphabetically by Post slug.
I’m simply using the “post_date” option suggested in the support page.
Thanks for the suggested alternative. I may try it, though I’m quite averse to entering the new editors.
Regards, doc
-
@supernovia,
Re:I’m thinking the list pages shortcode isn’t intended to set the pages in a specific order.
Secondly, the list pages shortcode does display 6 of 7 items in the proper chronological order in the example referred to above, which is visible on my site in the sidebar. Only one item is continually displayed out of chronological order as I add new items.
-
Ah, my apologies. I totally misunderstood the first post. You are sorting by post date… I’d somehow thought you were trying to sort them in the order listed.
I’ll do some digging.
-
Also, I’ve found your draft; if you’ll leave that as-is we’ll do testing with that. Is that fine?
-
@ supernovia,’
No worries.Also, I’ve found your draft; if you’ll leave that as-is we’ll do testing with that. Is that fine?
Well, I’ve already revised it a bit. But, yes, you may use that draft page for testing. I’ll leave it as is for a while.
-
No worries, I wasn’t able to duplicate this on my test site at first, but I have it now. I’ve filed a bug report and will let you know our findings. Cheers!
-
-
To whom it may concern,
The issue reported in the OP persists. Today, my latest addition is also displayed out of order when using List Pages shortcode. I now have two of the nine most recent pages listed in the wrong chronological order by the shortcode.
-
- The topic ‘List pages shortcode not displaying in correct order’ is closed to new replies.