Homepage Slider Media Categor
-
Hello,
I am using the Formation theme on a new site. Rather than having the homepage slider pull images from blog posts, I would like to choose which photos from my Media collection go into the slider.
To start this process, I wrote a plugin to add a “Category” option to photos uploaded to the Media library. I created a category for those called “homepage image” However, I noticed that the homepage slider dropdown list does not include that category unless there is a blog post (rather than a Media item) with that category. I am trying to figure out how to get it to pull categorized images from the Media library rather than pulling images from my Posts (starting with making categories only relevant to the Media library visible in the dropdown list in the homepage customizer.I was trying to figure out if I can accomplish this by changing this code in the “Custom Home Page Page Template”, but I haven’t been able to figure it out. ::
<?php
$featured_cat = get_theme_mod( ‘homepage_slider_cat’ );
$number = get_theme_mod( ‘homepage_slider_slide_no’ );$the_query = new WP_Query( array(
‘cat’ => $featured_cat,
‘posts_per_page’ => $number,
‘meta_query’ => array(
array(
‘key’ => ‘_thumbnail_id’,
‘compare’ => ‘EXISTS’,I would appreciate any advice you have on this.
Thanks!
- The topic ‘Homepage Slider Media Categor’ is closed to new replies.