Order of Speaker Pics

Best WordPress theme for festivals or other events with responsive, clean and unique design.
GK User
Tue Nov 19, 2013 8:51 pm
How do I change the order that speaker picture appear in the speakers widget? And how do I control which one starts in the center?
User avatar
Fresh Boarder

GK User
Wed Nov 20, 2013 3:13 pm
Hello,

The speakers items are displayed in the same order as it was added. If you want to change the ordering type, currently the only way is modyfing the query in the gavern/widgets.speakers.php file on the theme directory or you can rewrite your speakers posts.

The line responsible for the query is following:

Code: Select all
$gk_loop = new WP_Query( 'category_name=' . $category . '&post_type=' .$options_tmp['name']);


If you want to put somebody in the center on start then this person should be placed as a third person.
User avatar
Administrator

GK User
Sun Dec 01, 2013 2:55 pm
Hi,
how can I set the order to random or reverse the order?
Thanks,
Damian
User avatar
Fresh Boarder

GK User
Sun Dec 01, 2013 4:39 pm
cyberstrona wrote:Hi,
how can I set the order to random or reverse the order?
Thanks,
Damian


I forgot to mention I mean the order in widget and speakers page view(category/speakers).

Best,
Damian
User avatar
Fresh Boarder

GK User
Sun Dec 01, 2013 9:56 pm
You have to apply the proper params in WP_Query - in this case very useful can be this generator: http://generatewp.com/wp_query/

On the category-speakers.php the code responsible for the query is following:

Code: Select all
$args = array( 'post_type' => $tmp['name'], 'posts_per_page' => 100 );
$loop = new WP_Query( $args );
User avatar
Administrator

GK User
Mon Dec 02, 2013 5:02 pm
Many thanks for the link to generator, is very helpful.
I come from Drupal and there I could manage queries with GUI of Views module. I'm new to Wordpress but with this generator I can also manage the queries very easy.
Best,
Damian
User avatar
Fresh Boarder


cron