WordPress.org

Ready to get started?Download WordPress

Forums

Gamepress Custom post type problem. (4 posts)

  1. Arterus
    Member
    Posted 1 year ago #

    Hi all,

    First I would like to say that I would highly recommend the free, Gamepress theme, it's very well put together and very user friendly! However I'm having an issue with it...

    I am using a custom post type, and for the slider I am using a specific category to pull images from.

    This only works with 'Posts' and not my own custom post type.

    Example.. The category I am using is 'New release' and if I make a new 'Post' and check 'New Release' and give it a featured image it works. The featured image is shown in the slider.

    However, if I use my own custom post type, and tick 'New Release' make sure its got a featured image... No image shows..

    Could anyone shed any light on why that may be please?

    Thanks,

    Art.

  2. alex27
    Member
    Posted 1 year ago #

    Home page slider will not work with your custom post type, only with post types built in GamePress (Reviews and Videos). To achieve this you'd have to modify one of the files (depending on wchich option of Nivo slider you're using) located in includes folder. Use the code you'll find there as example, and you should be able to exapnd it to include your custom post type.

  3. Arterus
    Member
    Posted 1 year ago #

    Thanks Alex, your work and effort on the Theme are greatly appreciated. I will try that out tomorrow and let you know how I get on.

    Art.

  4. Arterus
    Member
    Posted 1 year ago #

    Hmm, just had a quick look at this and it seems its beyond my realm of knowledge.

    <?php
    	$tmp = $wp_query;
            $variant = of_get_option('gamepress_slider_variant');
            $limit = (int)of_get_option('gamepress_slider_limit');
               if( $limit ) :
                   $limit = of_get_option('gamepress_slider_limit');
               else:
                   $limit = 4;
               endif;
    
                    if( $variant == '1') :
                        $cat = of_get_option('gamepress_slider_category');
                        $wp_query = new WP_Query( array( 'cat' => $cat, 'posts_per_page' => $limit ) );
                    else :
                        $wp_query = new WP_Query( array( 'posts_per_page' => $limit, 'post_type' => array( 'post', 'gamepress_reviews', 'gamepress_video') ) );
                    endif;
    
    				if(have_posts()) :
    					while(have_posts()) :
    						the_post();
    			?>

    I guess it's in there somewhere, but I have no idea how to add mine too it :(

    Thanks anyway,

    Art.

Topic Closed

This topic has been closed to new replies.

About this Topic