Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #450788

    Hi, in the Combo widget (sidebar): how can i display the Recent posts instead of the Popular posts by default?

    Also, how can I add a widget title so it looks consistent and neat like the other widgets?

    Thank you

    #451046

    Hi Vincent!

    Thank you for using Enfold.

    You can modify framework > php > class-framework-widgets.php, look for this code:

    echo $before_widget;
    			echo "<div class='tabcontainer border_tabs top_tab tab_initial_open tab_initial_open__1'>";
    
    			echo '<div class="tab first_tab active_tab widget_tab_popular"><span>'.__('Popular', 'avia_framework').'</span></div>';
    			echo "<div class='tab_content active_tab_content'>";
    			avia_get_post_list('cat=&orderby=comment_count&posts_per_page='.$posts);
    			echo "</div>";
    
    			echo '<div class="tab widget_tab_recent"><span>'.__('Recent', 'avia_framework').'</span></div>';
    			echo "<div class='tab_content'>";
    			avia_get_post_list('showposts='. $posts .'&orderby=post_date&order=desc');
    			echo "</div>";

    Replace it with:

    echo $before_widget;
    			echo "<div class='tabcontainer border_tabs top_tab tab_initial_open tab_initial_open__1'>";
    
    			echo '<div class="tab first_tab active_tab widget_tab_recent"><span>'.__('Recent', 'avia_framework').'</span></div>';
    			echo "<div class='tab_content'>";
    			avia_get_post_list('showposts='. $posts .'&orderby=post_date&order=desc');
    			echo "</div>";
    			
    			echo '<div class="tab widget_tab_popular"><span>'.__('Popular', 'avia_framework').'</span></div>';
    			echo "<div class='tab_content active_tab_content'>";
    			avia_get_post_list('cat=&orderby=comment_count&posts_per_page='.$posts);
    			echo "</div>";

    Best regards,
    Ismael

    #451101

    Hi Ismael,

    Even though that changes the tab order around. It did not change the posts order. It now has the following: Recent, Popular, Comments. But the Popular posts are still displaying as default under Recent.

    On the second part of that question I requested if there is a way I can add a title to the widget so that it is consistent with other sidebar widgets and looks nice.

    Is there a way to do this?

    Thank you

    • This reply was modified 9 years, 2 months ago by Vincent.
    #451973

    It’s still showing the popular posts firsts.

    Thanks

    #451990

    Hey!

    can you please provide a link to your website showing the issues you are talking about? I think screenshots would help as well (imgur.com, dropbox).

    Widget area is nothing related and controlled by WordPress itself. You might find more information here:
    https://wordpress.org/support/topic/how-to-change-widget-title
    http://codex.wordpress.org/WordPress_Widgets

    Cheers!
    Andy

    #451996

    Hi Andy,

    I think you may have misread my post. Ismael supplied the fix. However, the order is still incorrect with popular posts appearing first. It has everything to do with this theme as the plugin is the combo widget.

    Thanks
    Vincent

    #453457

    Hi Vincent,

    The modified code should be:

    			echo $before_widget;
    			echo "<div class='tabcontainer border_tabs top_tab tab_initial_open tab_initial_open__1'>";
    
    			echo '<div class="tab first_tab active_tab widget_tab_recent"><span>'.__('Recent', 'avia_framework').'</span></div>';
    			echo "<div class='tab_content active_tab_content'>";
    			avia_get_post_list('showposts='. $posts .'&orderby=post_date&order=desc');
    			echo "</div>";
    			
    			echo '<div class="tab widget_tab_popular"><span>'.__('Popular', 'avia_framework').'</span></div>';
    			echo "<div class='tab_content'>";
    			avia_get_post_list('cat=&orderby=comment_count&posts_per_page='.$posts);
    			echo "</div>";

    Cheers!
    Josue

    #454621

    Thanks Josue

    That worked perfectly.

    Cheers
    Vince

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Change Order of Tabs on Combo Widget’ is closed to new replies.