How to get Custom Content Types working with GKNewsShow Pro?

Best WordPress theme for game news websites, game portals or whatever your preferred subject.
GK User
Fri Nov 09, 2012 1:54 pm
I would like to know what I have to do to get custom content types to work with the GK News Show pro.
This is vital for me since the whole theme is based around widgets areas and the GK News Show pro widget.
User avatar
Junior Boarder

GK User
Fri Nov 09, 2012 6:54 pm
Hi,

It will need a deeper ingerence into the module code. I can try to implement it for you in this weekend, but I'll need an FTP and administrator access to your website - if you agree, you can send it using the PM message and then I'll work with this problem on tommorow and on Sunday.
User avatar
Administrator

GK User
Fri Nov 16, 2012 6:03 pm
My current development site is on a local server, since the live site has around 100k visitors a month.

But I believe that many more people then me will find this very useful. Custom post types on a wordpress site is very common these days. And without GK news show pro this theme is useless.

Is it possible to make it available in the live version of the theme?
User avatar
Junior Boarder

GK User
Fri Nov 16, 2012 11:03 pm
OK, I'll work with it on the weekend, then I'll release an information here about the works progress :)
User avatar
Administrator

GK User
Fri Nov 16, 2012 11:07 pm
That's Awesome! :woohoo:
User avatar
Junior Boarder

GK User
Sat Nov 17, 2012 3:03 pm
Hi again,

As I've earlier promised, I've prepared the NSP widget with support for the Custom Post Types - I've modified the widget on the Fest theme (because it contains the custom post type - gavern_speakers).

So please replace the widget file with the attached one, and then you will see in the back-end for the "Data source" option "Custom post types" - then you have to specify in the below field the proper post type name (you can separate few post types with comma). Enjoy :)
User avatar
Administrator

GK User
Sun Nov 18, 2012 2:22 am
Whoah, you are a legend dziudek! 10/10!

I will try it out tomorrow night :)
User avatar
Junior Boarder

GK User
Tue Nov 20, 2012 6:05 pm
The widget update works perfect! Could not be happier with the suport and help from you dziudek :cheer:

Note: People that would like to use this widget, dont forget to rename the file widget.nsp.php to widgets.nsp.php other wise it will not replace the actual file which is located in THEME/gavern.

Thanks again!
User avatar
Junior Boarder

GK User
Tue Nov 20, 2012 6:32 pm
Maybe I cheered a bit to early, the NSP widgets are only fetching and presenting the latest post in each custom post type.

I have tried every solution I can come up with but cant get it to fetch all of the posts within the custom post types.

Could there be a little bug here?
User avatar
Junior Boarder

GK User
Tue Nov 20, 2012 7:08 pm
You're right - I haven't saw it earlier, because the query was ok, but the problem was with the output functions. I've attached the fixed version - it should works correctly now :)
User avatar
Administrator

GK User
Wed Nov 21, 2012 12:01 am
That problem got fixed, but I think it introduced another one. Now it only fetches one custom post type.

So say that I want to display movies and books in the same NSP widget, it only displays the first chosen one.

If I type movies,books only movies will be displayed. And the other way around books will be displayed.
User avatar
Junior Boarder

GK User
Wed Nov 21, 2012 8:28 am
Could you replace in the code widgets.nsp.php fragment:

Code: Select all
foreach($post_type as $type) {
   array_push($results, get_posts(array('post_type' => $type, 'numberposts' => $amount_of_posts)));
}


to:

Code: Select all
array_push($results, get_posts(array('post_type' => $post_type, 'numberposts' => $amount_of_posts)));


and check if it is working? Because currently I have no installations with more custom post types ;)
User avatar
Administrator

GK User
Wed Nov 21, 2012 3:26 pm
That works perfect!

The edited file is attached below.
User avatar
Junior Boarder

GK User
Wed Nov 21, 2012 7:04 pm
Good to hear it :) I'll implement this version in the nearest update :)
User avatar
Administrator


cron