-
AuthorPosts
-
May 27, 2015 at 8:19 pm #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
May 28, 2015 at 10:02 am #451046Hi 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,
IsmaelMay 28, 2015 at 11:13 am #451101Hi 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, 6 months ago by Vincent.
May 30, 2015 at 11:11 am #451973It’s still showing the popular posts firsts.
Thanks
May 30, 2015 at 1:00 pm #451990Hey!
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_WidgetsCheers!
AndyMay 30, 2015 at 1:28 pm #451996Hi 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
VincentJune 3, 2015 at 1:32 am #453457Hi 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!
JosueJune 4, 2015 at 5:33 pm #454621Thanks Josue
That worked perfectly.
Cheers
Vince -
AuthorPosts
- The topic ‘Change Order of Tabs on Combo Widget’ is closed to new replies.