Site icon Hip-Hop Website Design and Development

Combining classes (Question posts with a number of taxonomy phrases)

I am making an attempt to show a listing of all posts from a number of classes (if anybody solutions this, you may need to embody combining tags as effectively, as in all probability that may make this reply complete for future seekers).

Here is what I am working with:

This operate works to indicate a listing:

operate my_custom_loop_three_posts($class, $tag, $offset) {
        $args=array(
          // showposts has been changed, use 'posts_per_page' as an alternative
          // 'showposts'        => 1,
          'posts_per_page'      => 3,
          // this has been changed, use 'ignore_sticky_posts'
          // 'caller_get_posts' => 1,
          'ignore_sticky_posts' => true,
        );

        if ($class) {
          $args['cat'] = $class;
        }

        if ($tag) {
          $args['tag'] = $tag;
        }

        if ($offset) {
          $args['offset'] = $offset;
        }

        $my_query = new WP_Query($args);
        // ... remainder of operate to output loop 

if( $my_query->have_posts() ) {
            whereas ($my_query->have_posts()) : $my_query->the_post(); ?>
             <div class="">
              <a href="<?php the_permalink() ?>" >
   <div class="menu-item-list-item menu-item-list-item-not-title">
      <?php the_title(); ?>
   </div>
              </a>
             </div>
            <?php
            endwhile;
        } //if ($my_query)

        wp_reset_query();  // Restore international publish knowledge stomped by the_post().   
 };


operate myFilter($question) {
    if ($query->is_feed) {
        $query->set('cat','-121');
    }
return $question;
}
add_filter('pre_get_posts','myFilter');

And I simply use this to show the record on a web page:

<?php my_custom_loop_three_posts(330, NULL, 1); ?>

As a result of this operate works nice, I hoped to have the ability to modify it to indicate a number of classes / tags within the outcomes, however am a bit stumped on this. Perhaps it is easy, perhaps onerous? Options OR pointing me in the direction of how one can repair this welcome. Thanks