Featured Image Slider – Want to display one category
-
Hi all,
I’m quite new to WordPress and would like help with restricting a part of my site to showing only a certain product category.
I have a ‘Featured Post Slider’ on my site and would like it to only display one category, I have the ID – just have no idea where to edit the code..
<?php $querydetails = " SELECT wposts.* FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = 'omc_featured_post' AND wpostmeta.meta_value = '1' AND wposts.post_status = 'publish' AND wposts.post_type = 'post' ORDER BY wposts.post_date DESC "; $pageposts = $wpdb->get_results($querydetails, OBJECT) ?> <?php $i = 0; if ($pageposts): foreach ($pageposts as $post): setup_postdata($post); $category = get_the_category(); $omc_is_video = get_post_meta(get_the_ID(), 'omc_is_video', true); $i++; $format = get_post_format(); if ($i <9) { ?>
Any help would be greatly appreciated.
Many thanks,
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Featured Image Slider – Want to display one category’ is closed to new replies.