Speakers Alphabetical Ordering

Best WordPress theme for festivals or other events with responsive, clean and unique design.
GK User
Mon Sep 16, 2013 4:31 pm
Is there a way to display speakers alphabetically rather than date of publish?
User avatar
Fresh Boarder

GK User
Mon Sep 16, 2013 7:26 pm
Please edit file:

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


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

GK User
Tue Sep 17, 2013 11:12 pm
Please tell me what file to edit.
User avatar
Fresh Boarder

GK User
Wed Sep 18, 2013 10:24 am
Oh, sorry...
wp-content/themes/Fest/gavern/widget.speakers.php
User avatar
Moderator

GK User
Wed Sep 18, 2013 12:43 pm
I made that change and performed a hard refresh but it did not alphabetize. Do I need to rename the file to match my category (wineries)?
User avatar
Fresh Boarder

GK User
Wed Sep 18, 2013 9:22 pm
Have You saved widget settings to force reload of data?
User avatar
Moderator

GK User
Thu Sep 19, 2013 2:25 pm
I don't understand. What widget would I resave and why would a widget have control of the ordering of the category?

I resaved GK-Speakers, but that had no effect.
User avatar
Fresh Boarder

GK User
Thu Sep 19, 2013 3:22 pm
Widgets are cached, also their content is cached, so when You change something in source code, WP requires to hit save on widget to recreate cache. But this is not an issue here.
Ill test the solution again and write back with correct answer.
User avatar
Moderator

GK User
Thu Sep 19, 2013 3:26 pm
Right, I understand the caching issue. My question was along the lines of why the widget would have an effect when the widget isn't part of the problem :laugh:
User avatar
Fresh Boarder

GK User
Thu Sep 19, 2013 3:28 pm
Please try with this code:
Code: Select all
$gk_loop = new WP_Query( 'category_name=' . $category . '&post_type=' .$options_tmp['name'].'&order=ASC&orderby=title');

Again, save changes to php file, upload it and save settings on Speakers widget (I know its dummy ;) ).
User avatar
Moderator

GK User
Thu Sep 19, 2013 3:34 pm
No luck.

http://vintageillinois.com/category/wineries/

Still in order of publish date (I think).

Wade
User avatar
Fresh Boarder

GK User
Thu Sep 19, 2013 4:14 pm
Oh, I thought You refer to homepage speakers widget :(.
User avatar
Moderator

GK User
Thu Sep 19, 2013 4:17 pm
wp-content/themes/Fest/category-speakers.php
change from:
Code: Select all
$args = array( 'post_type' => $tmp['name'], 'posts_per_page' => 100 );

to:
Code: Select all
$args = array( 'post_type' => $tmp['name'], 'posts_per_page' => 100, 'order' => 'ASC', 'orderby' => 'title');

Should solve Your problem.
User avatar
Moderator

GK User
Thu Sep 19, 2013 7:55 pm
That did it. Thanks. My apologies for not being clear.

Wade
User avatar
Fresh Boarder

GK User
Thu Sep 19, 2013 10:10 pm
No problem :). Im glad it worked out.
User avatar
Moderator


cron