Fetch posts from particular category in given code
-
Hi guys,
My theme uses a background image for the single posts. But the problem is my high resolution images are only in ‘Featured’ category and all the other images from various categories are low res.
So I want that the posts fetch images for background only from the featured category and not any random image from all images. This code in footer interested me as it seems to be doing the job of fetching images, but I couldn’t resolve the issue.
Thanks in advance. 🙂
// Random image from post gallery if(get_post_meta($pageID, $shortname.'_show_random_fullsize_value', true) == 'true'){ $term_id_array = array(); foreach($post_terms as $index => $value){ $term_id_array[$index] = $index; } $random_post = max_query_term_posts( 1 , $term_id_array, 'gallery', 'rand' );For example on this post, http://photography.vigaversa.com/gallery/yellows-blooming-at-her-feet/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Fetch posts from particular category in given code’ is closed to new replies.