Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #531048

    I’m interested in removing a single category (Education – ID=4) from the Enfold Combo Widget – specifically the “Popular” section.

    Can someone provide me with the code to make this happen?

    Thanks so much!

    #531619

    Any assistance on this?

    Thanks in advance!

    #532562

    Hey!

    where can we find the element in question on your website? don’t know where to look at. Can you highlight using screenshots please? you can use imgur.com or dropbox.

    Cheers!
    Andy

    #532811

    Sure thing. Attached as private content.

    Thanks Andy!

    #533063

    Hi!

    You will have to modify the core files for that. Please edit framework > php > class-framework-widgets.php then look for the “avia_combo_widget” class. Go to line 941, look for this code:

    avia_get_post_list('cat=&orderby=comment_count&posts_per_page='.$posts);
    

    .. replace it with:

    avia_get_post_list('cat=-4&orderby=comment_count&posts_per_page='.$posts);
    

    The above modification works for the combo widget. If you want to modify the latest news widget query, look for the “avia_newsbox” class.

    Regards,
    Ismael

    #533821

    Ismael,
    The changes for the combo widget worked perfectly. Thank you!

    I, however, could not figure out how to make the same changes to avia_newsbox — I didn’t locate a string similar to the one provided for avia_combo_widget. Can you provide me a little more guidance?

    Thanks so much,
    Brandon

    #534184

    Hi!

    If you are using the latest version of the theme, please check around 919th line – http://i.imgur.com/BX3URcj.png

    Cheers!
    Yigit

    #535067

    Thanks Yigit.

    I WAS able to find and make the changes to the avia_combo_widget thanks to Ismael’s original post. I, however, haven’t had any luck with making the same changes to avia_newsbox.

    Can you help me with this?

    Thanks!

    #536014

    Hey!

    If the latest news widget is in use, there’s an option to select the categories so you don’t need to modify the query. If you’re still interested with the query, you can find it around line 477:

    $new_query = array(	"posts_per_page"=>$count, 'tax_query' => array(
    														array( 'taxonomy' => $this->avia_term,
    															   'field' => 'id',
    															   'terms' => explode(',', $cat),
    															   'operator' => 'IN')
    															  )
    														);

    Look for the category__not_in parameter for more info: https://codex.wordpress.org/Class_Reference/WP_Query

    Best regards,
    Ismael

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