Hueman Dynamic Tabs
-
Hi again!
I want to display random blog posts in my right hand sidebar using the Hueman Theme. Hueman Dynamic Tabs displays a perfect layout with thumbnail and blog title. How do I get it to display them randomly?
See this link http://qsign.se/
The top of the right sidebar displays the layout I want (thumbnail to the left and blog title to the right) but I can’t control how the posts are displayed. In the bottom part of the right sidebar I have tried using Category Posts Sidebar Widget, but this layout doesn’t display well and I can’t control the size of the headings (also the fontsize of the headings change when I navigate the website – very odd).
-
Hi christinamaria.
1. Using your host file manager (cPanel) or FTP, create a /functions/widgets folder in your child theme.
2. Copy the parent theme /functions/widgets/alx-tabs.php template file to the same folder in your child theme.
3. In the child theme alx-tabs.php file change the ‘orderby’ parameter for the Popular Posts query from ‘comment-count’ to ‘rand’:
<?php $popular = new WP_Query( array( 'post_type' => array( 'post' ), 'showposts' => $instance['popular_num'], 'cat' => $instance['popular_cat_id'], 'ignore_sticky_posts' => true, 'orderby' => 'rand', 'order' => 'dsc', 'date_query' => array( array( 'after' => $instance['popular_time'], ), ), ) ); ?>
Reference: https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
If you don’t currently have a child theme you can install one using the instructions here:
http://docs.presscustomizr.com/article/239-using-a-child-theme-with-huemanThankyou bdbrown! I have now managed to fix it – with your eminent help!
You’re welcome; glad you got it working.
Is there a possibility to ADD a random Tab for Hueman Tabs instead of replacing existing $popular?
I want to use both of it ^^by the way: I created all the needed parts as you explained but the random order (even when I edit the $popular section) does not work. What am I doing wrong?
thx in advance
- This reply was modified 7 years, 3 months ago by Heiko.
- The topic ‘Hueman Dynamic Tabs’ is closed to new replies.