Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #6480

    Hello -

    I am working off a child theme of Newscast. I have a custom post type registered and have the native wordpress taxonomies associated with this custom post type.

    I have also selected a specific category to display on the slider. When I select this category within the custom post type it DOES NOT appear on the accordion slider.

    Does the slider not call custom post types even if it resides in the same category?

    Any help would be appreciated.

    Thanks

    #54318

    Hey,

    no – the slider supports “standard post” only because the query searches for categories and not taxonomies/terms. You can modify the query in index.php – search for following code:

    $additional_loop = new WP_Query("cat=".$k_option['mainpage']['feature_cats_final']."&posts_per_page=".$k_option['mainpage']['feature_count']);

    #54319

    Yes but can I display both the category selected in the mainpage options as well as displaying custom posts? In other words can I run multiple loops here?

    #54320

    I think it’s even possible to combine both post types in one query by using arrays, etc. as parameters (some nice code snippets can be found here: http://codex.wordpress.org/Class_Reference/WP_Query ). However the easiest solution may be to duplicate the query loop and to modify the second or the first query to your needs.

    #54321

    I got both post types to return by doing this:

    $additional_loop = new WP_Query( array
    ( 'post_type' => array('tribe_events','post' )),
    ("cat=".$k_option['mainpage']['feature_cats_final']."&posts_per_page=".$k_option['mainpage']['feature_count']));

    But it is not returning the category only and the proper post per page set in the options

    #54322

    SOLVED!

    $additional_loop = new WP_Query( array(
    'post_type' => array('post','tribe_events'),
    'cat' => $k_option['mainpage']['feature_cats_final'],
    'posts_per_page' => $k_option['mainpage']['feature_count'],
    )); // end slider query

    #54323

    Glad that you found the solution :)

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

The topic ‘Custom Post Type not showing in Accordion Slider’ is closed to new replies.