-
AuthorPosts
-
August 25, 2014 at 11:23 pm #309003
Hey there,
I’ve added to a page the “Article” element using the Advanced Content Editor.
The page has the default template assigned.
How can I change the order of the articles shown (asc & desc) ?Thanks in advance.
August 25, 2014 at 11:44 pm #309006Hey HIO2014!
As far as I know blog posts within WordPress always appear in the order they are published. The element doesn’t have an ordering option in this case.
Regards,
DevinAugust 26, 2014 at 9:15 am #309193Hi Devin,
blog posts can be ordered using this string:<?php query_posts($query_string . "&order=ASC") ?>Since I’ve used the AVIA Element, i don’t know where to put this code (usually placed in the archive.php file).
Any suggestion?
TY!
August 26, 2014 at 9:27 am #309197Hey!
Try adding this at the very end of your theme / child theme functions.php file:
function change_order_blog_element($query) { $query = array_merge($query, array('order'=>'ASC')); return $query; } add_filter('avia_blog_post_query', 'change_order_blog_element', 10, 2);Cheers!
JosueAugust 26, 2014 at 10:02 pm #309548It seems there’s an error, it doesn’t work.
May I send you my functions.php file?
Otherwise, here’s the code…August 26, 2014 at 11:10 pm #309561Hey!
What error did you get? make sure you are using the latest version of Enfold and put the custom code at the very end of the functions.php file.
Best regards,
JosueAugust 26, 2014 at 11:28 pm #309569I have Theme Version Number: 2.9.1
Now it works… but I had to edit functions-enfold.php file, not functions.php .
Ty Josue!
August 26, 2014 at 11:30 pm #309570You are welcome. Also, you could put it on the functions.php of the child theme (if you use one), or use a plugin like Functionality to abstract custom functions from the theme files.
Cheers!
Josue -
AuthorPosts
- You must be logged in to reply to this topic.
