Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #502943

    It looks like our posts are being sorted either by creation date or post id and not the publish date. How can we change this?

    #503185

    Hi endoradigital!

    Thank you for using Enfold.

    You can change the query by using this filter on functions.php file:

    add_filter('avia_blog_post_query', 'avia_blog_post_query_mod');
    
    function avia_blog_post_query_mod( $query ) {
    $query['orderby'] = 'title';
    $query['order'] = 'DESC';
    return $query;
    }

    Refer to this link for more order and orderby parameters: https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters

    Best regards,
    Ismael

    #503479

    Isn’t this going to order it by title. I was looking to order it by publish date rather than the creation date or post id.

    #503484

    Hey!

    You can simply change “title” to “date” in Ismael’s code above.

    Regards,
    Yigit

    #503502

    I did make your changes; however, April 30, 2012 is still displaying before June 11, 2012.

    #503695

    Hi!

    can you show us the filter you have used in your functions.php?

    Cheers!
    Andy

    #503699

    Here is my whole functions.php file

    <?php
    
    //add_action( 'ava_after_main_menu', 'enfold_customization_header_widget_area' );
    //function enfold_customization_header_widget_area() {
    //	dynamic_sidebar( 'Header - Middle' );
    //}
    //add_action( 'ava_after_main_menu', 'enfold_customization_header_widget_area2' );
    //function enfold_customization_header_widget_area2() {
    //	dynamic_sidebar( 'Header - Right' );
    //}
    /*
    
     * Add social sharing icons to to bottom of every page in the content area exceopt for home page
    
    */
    
    add_filter('avf_template_builder_content', 'avia_add_social_toolbar_template_builder', 10, 1);
    function avia_add_social_toolbar_template_builder($content = "")
    {
    	if( !is_home() && !is_front_page() ) {
    		$content .= avia_social_share_links(array(), false, '', false);
    		$content .= '';
    	}
    	return $content;
    }
    
    /*
    
     * Remove brackets [...] from the end of the excerpt
    
    */
    function change_excerpt( $text )
    {
    	$pos = strrpos( $text, '[');
    	if ($pos === false)
    	{
    		return $text;
    	}
    	
    	return rtrim (substr($text, 0, $pos) ) . '....';
    }
    add_filter('get_the_excerpt', 'change_excerpt');
    
    add_filter('avia_blog_post_query', 'avia_blog_post_query_mod');
    
    // Change archive category page to order by publish date i.e. directors posts 
    
    function avia_blog_post_query_mod( $query ) {
    $query['orderby'] = 'date';
    $query['order'] = 'DESC';
    return $query;
    }
    ?>
    #503874

    Hi!

    Thank you for the info. Try to change the “order” parameter to “ASC” instead of “DESC”.

    Best regards,
    Ismael

    #506585

    That still did not change anything.

    #506820

    Hi,

    Could you please provide us with a temporary admin login so that we can take a closer look? You can post the details in the Private Content section of your reply.

    Best regards,
    Rikard

    #507221

    Here is the login information. It seems the code changes the main articles page ( http://www.stevens-tate.com/news-insights/articles/ ), but not the category Directors page ( http://www.stevens-tate.com/category/blog/directors/ )

    • This reply was modified 9 years, 2 months ago by endoradigital.
    #507598

    Hi!

    My bad. We replaced the code in the functions.php file. Please hard refresh the page: http://www.stevens-tate.com/category/blog/directors/

    Cheers!
    Ismael

    #507973

    Thank you for looking at this; however, these are still not in order by date…

    20 Years Later, Start Up Lessons From a Chicago Ad Agency
    June 11, 2012/in Advertising, Articles, Directors

    3 of 13 Key Marketing Initiatives
    November 6, 2013/in Articles, Directors, Media, Media Strategy

    3D Printing Is The Future Of Manufacturing
    April 8, 2015/in Articles, Directors

    4 Solid Tips For Marketing To Millennials
    June 12, 2014/in Articles, Directors, Marketing Strategy

    New 5 unique packaging
    5 Unique Household Packaging Designs You’ll Never Expect
    October 23, 2013/in Articles, Creative & Messaging, Directors

    A blog for those who don’t believe in Marketing
    September 11, 2014/in Advertising, Articles, Directors, Marketing Strategy

    A Super “Bowl” Filled To The Rim With Doritos
    February 8, 2010/in Articles, Directors, Media

    Another Year of Super Bowl Commercials?
    February 3, 2014/in Advertising, Articles, Directors, Media

    • This reply was modified 9 years, 2 months ago by endoradigital. Reason: Removed directors names
    #508173

    Hi!

    Alright. Please adjust the code in the functions.php file, from “title” to “date”.

    Regards,
    Ismael

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