-
AuthorPosts
-
September 14, 2015 at 5:48 pm #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?
September 15, 2015 at 10:56 am #503185Hi 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,
IsmaelSeptember 15, 2015 at 4:42 pm #503479Isn’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.
September 15, 2015 at 4:45 pm #503484September 15, 2015 at 4:57 pm #503502I did make your changes; however, April 30, 2012 is still displaying before June 11, 2012.
September 15, 2015 at 9:08 pm #503695Hi!
can you show us the filter you have used in your functions.php?
Cheers!
AndySeptember 15, 2015 at 9:16 pm #503699Here 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; } ?>
September 16, 2015 at 9:40 am #503874Hi!
Thank you for the info. Try to change the “order” parameter to “ASC” instead of “DESC”.
Best regards,
IsmaelSeptember 21, 2015 at 6:13 pm #506585That still did not change anything.
September 22, 2015 at 8:38 am #506820Hi,
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,
RikardSeptember 22, 2015 at 4:56 pm #507221Here 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, 3 months ago by endoradigital.
September 23, 2015 at 10:56 am #507598Hi!
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!
IsmaelSeptember 23, 2015 at 4:45 pm #507973Thank 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, Directors3 of 13 Key Marketing Initiatives
November 6, 2013/in Articles, Directors, Media, Media Strategy3D Printing Is The Future Of Manufacturing
April 8, 2015/in Articles, Directors4 Solid Tips For Marketing To Millennials
June 12, 2014/in Articles, Directors, Marketing StrategyNew 5 unique packaging
5 Unique Household Packaging Designs You’ll Never Expect
October 23, 2013/in Articles, Creative & Messaging, DirectorsA blog for those who don’t believe in Marketing
September 11, 2014/in Advertising, Articles, Directors, Marketing StrategyA Super “Bowl” Filled To The Rim With Doritos
February 8, 2010/in Articles, Directors, MediaAnother Year of Super Bowl Commercials?
February 3, 2014/in Advertising, Articles, Directors, Media- This reply was modified 9 years, 3 months ago by endoradigital. Reason: Removed directors names
September 24, 2015 at 6:55 am #508173 -
AuthorPosts
- You must be logged in to reply to this topic.