Slider Revolution WP
09.06.2016
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
if(is_tag()) $my_posts = get_posts(array('tag' => get_query_var('tag'))); else if(is_author()) $my_posts = get_posts(array('author' => get_query_var('author'))); else if(is_date()) $my_posts = get_posts(array('m' => get_query_var('m'))); else $my_posts = get_posts(array('cat' => get_query_var('cat'))); $my_post_ids = array(); foreach($my_posts as $post) { array_push( $my_post_ids, $post -> ID ); } echo do_shortcode('[ess_grid alias="my-grid" posts="'.implode(',', $my_post_ids).'"]'); |
But this code can also be added to another one of your theme’s php files, such as “category.php”, “index.php”, etc.