-
AuthorPosts
-
February 28, 2023 at 11:33 pm #1399587
working on directionscounseling.com
if you look at one of the clinician pages such as: https://www.directionscounseling.com/counselors/brenton-beckley/
you will notice that the sidebar is showing all the other clinicians by listing the portfolio items in descending order. I would like this to show in ascending order. I don’t see the option anywhere to change this. How do I change the sort order?March 1, 2023 at 8:43 am #1399617Hey satucker,
Thank you for the inquiry.
This is possible but you will have to directly modify the posts query in the enfold/framework/php/legacy/class-framework-widgets.php file. Please look for this code around line 944.
$new_query = array( "posts_per_page"=>$count, 'tax_query' => array( array( 'taxonomy' => $this->avia_term, 'field' => 'id', 'terms' => explode(',', $cat), 'operator' => 'IN') ) );
We have to add the order parameter to the query and set its value to “DESC”.
$new_query = array("order" => "DESC", "posts_per_page"=>$count, 'tax_query' => array( array( 'taxonomy' => $this->avia_term, 'field' => 'id', 'terms' => explode(',', $cat), 'operator' => 'IN') ) );
Best regards,
IsmaelMarch 2, 2023 at 3:27 am #1399741Thanks Ismael. I don’t often edit php but I think i got this right. Still no changes. Can you evaluate for me?
https://www.dropbox.com/s/hpul7b0u4ahu4gh/class-framework-widgets.php?dl=0March 2, 2023 at 9:40 am #1399769Hi,
We edited the code a bit. Please try it again.
$new_query = array("order" => "DESC", "posts_per_page"=>$count, 'tax_query' => array( array( 'taxonomy' => $this->avia_term, 'field' => 'id', 'terms' => explode(',', $cat), 'operator' => 'IN') )
We just moved the order parameter outside the tax_query.
Best regards,
IsmaelMarch 2, 2023 at 9:53 pm #1399900Unfortunately, this does not seem to have done the trick either. Other ideas?
March 3, 2023 at 4:38 am #1399928Hi satucker,
Can you try to modify enfold/framework/php/widgets/widget-classes/class-avia-newsbox.php (line 121):
$additional_loop = new WP_Query( "cat={$cat}&posts_per_page={$count}" );
replace it with:
$additional_loop = new WP_Query( "cat={$cat}&posts_per_page={$count}&order=ASC" );
Hope it helps.
Best regards,
NikkoMarch 3, 2023 at 2:40 pm #1400027Yes, do I leave the changes I made to the other pho file or do I put back to original code?
March 4, 2023 at 7:47 am #1400076Hi satucker,
You can put back the original code on the other files.
Just make sure every time you update the theme, you’ll need to update this file as well since updates remove all changes you made in the Enfold theme.Best regards,
NikkoMarch 5, 2023 at 8:33 pm #1400194will the changes be lost if they are made in a child theme?
Do i update the main theme file?
March 5, 2023 at 10:11 pm #1400204 -
AuthorPosts
- You must be logged in to reply to this topic.