Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.

    #309006

    Hey 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,
    Devin

    #309193

    Hi 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!

    #309197

    Hey!

    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!
    Josue

    #309548

    It seems there’s an error, it doesn’t work.

    May I send you my functions.php file?
    Otherwise, here’s the code…

    #309561

    Hey!

    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,
    Josue

    #309569

    I have Theme Version Number: 2.9.1

    Now it works… but I had to edit functions-enfold.php file, not functions.php .

    Ty Josue!

    #309570

    You 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

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.