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

    #1399617

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

    #1399741

    Thanks 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=0

    #1399769

    Hi,

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

    #1399900

    Unfortunately, this does not seem to have done the trick either. Other ideas?

    #1399928

    Hi 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,
    Nikko

    #1400027

    Yes, do I leave the changes I made to the other pho file or do I put back to original code?

    #1400076

    Hi 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,
    Nikko

    #1400194

    will the changes be lost if they are made in a child theme?

    Do i update the main theme file?

    #1400204

    Hi,
    You will need to update the parent theme file with each update, file in the /framework/php/ directory can not be added you your child theme.

    Best regards,
    Mike

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