Okay
  Public Ticket #1176652
HOME VERTICAL CAROUSEL
Closed

Comments

  • Dave started the conversation

    Hi,

    Loving the theme. Just a quick question about the Home Vertical Carousel. Is there an option to just have a certain category on this carousel?

  •  48
    djwd replied

    Hi there,

    sorry for the late reply, thanks for wiriting in.

    That is not possible natively, it would require a little modification to a template file. If you want to I can guide you through though.

    Regards
    djwd

  • Dave replied

    Hey, Yeah that would be great if you have the time.

    Kind regards

    Dave

  •  48
    djwd replied

    Hi there, sure:

    1. Open partials/part-sliders.php 

    2. Depending if you want to make the mod to primary slider or secondary slider, move respectively to line 29 (for primary) or 124 (for secondary). If you're using a single slider you want to edit the primary one.

    3. Replace this chunk of code (which is the same for both locations):

    $querydetails = "
    SELECT wposts.*
    FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
    WHERE wposts.ID = wpostmeta.post_id
    AND wpostmeta.meta_key = 'pm_featured_post_1'
    AND wpostmeta.meta_value = '1'
    AND wposts.post_status = 'publish'
    AND wposts.post_type IN ('post', 'page')
    ORDER BY wposts.post_date DESC
    ";

    with:

    $querydetails = "
    SELECT * FROM $wpdb->posts
    LEFT JOIN $wpdb->postmeta ON($wpdb->posts.ID = $wpdb->postmeta.post_id)
    LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id)
    LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
    WHERE $wpdb->term_taxonomy.term_id IN (1, 2, 3)
    AND $wpdb->term_taxonomy.taxonomy = 'category'
    AND $wpdb->posts.post_status = 'publish'
    ORDER BY $wpdb->postmeta.meta_value DESC;"
    ;

    4. Replace 1,2,3 in 

    WHERE $wpdb->term_taxonomy.term_id IN (1, 2, 3)

    with the desired category ID(s), that's it.

    Hope it helps

    Regards
    djwd