Hello @darren502,
I just tested “Search and Filter” and it perfectly works with EML taxonomies.
I used [searchandfilter taxonomies="media_category"]
shortcode, where media_category
is my custom category slug. If you created some taxonomies with EML you can see their slugs on that page where you created them.
Please also read this http://docs.designsandcode.com/search-filter/#how-to-use
To pull pictures via custom categories you have to use WP_Query http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters
Nadia
Thank you for your reply, I’ll try and see what I can do.
Btw you were right about using wp_query to get the pictures from the databses. I didn’t know wp_query even existed.lol I only know about SQL. Like i said before I’m new to wordpress.
Sorry to be of bother but, I’m getting through half-way through this task. I know how to pull up pictures from the wordpress database via wp-query. I was able to get some code that allowed me to pull images from the database. Of course, to use with EML i would have to customize it.
Here it is…
/* Function here used to get images from media library */
function get_images_from_media_library() {
$args = array(
'post_type' => 'attachment',
'post_mime_type' =>'image',
'post_status' => 'inherit',
'posts_per_page' => 1,
'orderby' => 'rand'
);
$query_images = new WP_Query( $args );
$images = array();
foreach ( $query_images->posts as $image) {
$images[]= $image->guid;
}
return $images;
}
function display_images_from_media_library() {
$imgs = get_images_from_media_library();
$html = '<div id="media-gallery">';
foreach($imgs as $img) {
$html .= '<img src="' . $img . '" alt="" height="" width=""/>';
}
$html .= '</div>';
return $html;
}
/* End of functions to get images */
However in order to get images from a specific category i’ve tried the following…
function get_images_from_media_library() {
$args = array(
'category_name' => 'mount-irvine',
I’m not sure if I’m using this category parameter correctly. When I read the documentation it stated that it is to be used with a category slug(not Name) I used the slug that I created with EML. I wonder is that correct??
Thanks, I’ll take a look at it.