Finally I tried loop id=”3053,3054,3055″ with and without orderby=”id” order=”ASC”, but unsuccesfully. I can’t get posts ordered by ID. I know I have my code within an Elegant Theme module, but the loop is working, not the ordering unfortunately. What can I do to have these posts ordered? With the first code: loop id=”3053,3054,3055″, I have only the second post displayed and if I add orderby=”id” order=”ASC”, I get nothing.
I looked into this, and found that WordPress query for orderby parameter only works with “ID” – it must be uppercase..
I’ll fix this in the next update, but until then, orderby="ID"
should work.
Thanks for your reply. Unfortunately neither orderby=”ID” nor orderby=”id” work for me, only [loop category=”foo”] is working actually. I tried loop ID=”3053,3054,3055″, with capital ID, but I had the same result as above, only the second post showed up.
Hello,
Please try the newest update. I tested it with and without Visual Composer.
That’s strange that orderby=”ID” didn’t work for you. Also, the fact that “only the second post showed up” sounds like something else is happening. I tested the id parameter with a list of post IDs, and it’s working fine on my end: all posts show up, and if I put orderby=id
, it sorts by ID as expected. It could be that a plugin or the theme is interfering with the loop.
Sorry for being late to reply.
[raw]
<div id=”mainwrapper”> [loop category=”foo” orderby=”ID”] <div id=”box-1″ class=”box”> [field thumbnail-link] <span class=”caption simple-caption”> <p>[field title]</p> </span> </div> [/loop] </div>
[/raw]
This is my code, in a plain page, with Divi theme.
It seems I can’t get it ordered.
Thanks for your support anyway
Anyway, I wanted to let you know that using loop id=”3053,3054,3055″ I get 3055 first. Isn’t this command “loop id” meant to have posts ordered according to the list? I have checked again and just the following [loop id=”3053,3054,3055″ orderby=”ID” order=”ASC”] [field title] [/loop] or simply [loop id=”3053,3054,3055″] [field title] [/loop] doesn’t change the order. I have Re-Order plugin installed. Any idea?
Yes, I am sorry, I forgot I had tried Post Type Order and after setting the order back to the original one, I have posts ordered. Shouldn’t your plugin work at a lower level than Post Type Order?
Thanks again!
Ah I see, yes, I’ve run into this problem before. Unfortunately, most of these drag-and-drop post order plugins work by filtering the WordPress query function, which Custom Content Shortcode uses to get posts.
I usually use the Simple Custom Post Order plugin, and if I remember correctly, for this plugin I have to specifically set orderby=menu to get the changed post order – otherwise, I can order it differently (by ID, name, etc.) in a CCS loop.
Well, I’ll look into this and see if I can improve it.