badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Can I use a custom post type featured image in the slider?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #19413
    spectrum_7
    Participant

    I am using the Events Manager plugin which creates a custom post type: EM_POST_TYPE_EVENT. I would like to feature these events in the slider. When I add the id into the slider options, the ‘Click Here To Edit’ button works and connects to the custom post. However the featured image does not show up in the slider.

    I added the custom post type into the array at line: 503 of header-extensions.php like this:

    'post_type'=> array( 'post', 'page' , 'EM_POST_TYPE_EVENT' ),

    Do have any advice on how to achieve this?

    Thanks.

    #19421
    spectrum_7
    Participant

    Okay I figured it out…

    I had the wrong name for my custom post type. =(. I put in the right name into the array and copied the whole function over to my functions.php file and it works great.

    #19425

    Ok that’s great spectrum_7

    Thank you!

    #61331
    alexmarcxyz
    Blocked

    Go to function.php file from your theme directory and then add this code to it:

    /* Custom Post Type Start */

    function create_posttype() {
    register_post_type( ‘news’,
    // CPT Options

    array(
    ‘labels’ => array(
    ‘name’ => __( ‘news’ ),
    ‘singular_name’ => __( ‘News’ )
    ),
    ‘public’ => true,
    ‘has_archive’ => false,
    ‘rewrite’ => array(‘slug’ => ‘news’),
    )
    );
    }
    // Hooking up our function to theme setup
    add_action( ‘init’, ‘create_posttype’ );

    /* Custom Post Type End */

    Once this code will be added, you will see the new post added into the dashboard, for creating custom post type WordPress you can follow this guide, it has all 3 types of posts tutorials.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.