Slider – displaying custom post types

  • Venutius

    #49654

    How would I get my custom post types to display in the slider?

    Admin

    Syahir Hakim

    #49666

    Copy and paste the following code into your child theme’s functions.php file:

    function my_graphene_slider_post_type( $post_types ) {
    	return array( 'post', 'custom-post-type' );
    }
    add_filter( 'graphene_slider_post_type', 'my_graphene_slider_post_type' );
    

    Replace custom-post-type with your own custom post type. In the above example, the standard “post” post type will also be displayed in the slider. If you don’t want that, just remove the “post” post type so the code looks like this:

    return array( 'custom-post-type' );
    

    Venutius

    #49672

    Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.