GK News Show Pro Order by Title + ASC

WordPress theme dedicated to start-up websites with amazing CSS3 animated icons, price tables and parallax effect background.
GK User
Fri Aug 08, 2014 11:47 am
Hi,

I'm using the GK News Show Pro widget to display custom post types. But it seems that the contents can only be ordered by ID only. I changed it to be ordered by Title + Ascending, but the widget does not change.

See the screenshot here: https://docs.google.com/file/d/0By7Nvk7 ... tBYTBkSnc/

Thanks!
User avatar
Junior Boarder

GK User
Fri Aug 08, 2014 12:11 pm
Could you please provide me with a URL to your website and back-end access via PM (click the “Private Message” text underneath my avatar) so that I may analyze it? It is a lot easier for us to diagnose issues when we have a live site to examine.
User avatar
Moderator

GK User
Sun Aug 10, 2014 7:34 pm
Of course. I already sent the information via PM.
User avatar
Junior Boarder

GK User
Mon Aug 11, 2014 7:58 am
Try to replace this fragment from Simplicity/gavern/widgets.nsp.php file:
Code: Select all
} else if($config['data_source_type'] == 'custom') {
         $post_type = explode(',', $config['data_source']);
         $results = get_posts(array(
               'post_type' => $post_type,
               'numberposts' => $amount_of_posts
            ));

with:

Code: Select all
} else if($config['data_source_type'] == 'custom') {
         $post_type = explode(',', $config['data_source']);
         $results = get_posts(array(
               'post_type' => $post_type,
               'numberposts' => $amount_of_posts,
               'offset' => $config['offset'],
               'orderby' => $config['orderby'],
               'order' => $config['order']
            ));


or you can use our external - more advanced GK News Shop pro plugin:
https://github.com/GavickPro/GK-News-Show-Pro
User avatar
Moderator

GK User
Mon Aug 11, 2014 10:19 pm
Thank you so much! Adding those few lines work perfectly.
User avatar
Junior Boarder


cron