Title: [Theme: Sampression Lite] Filter matched posts
Last modified: August 20, 2016

---

# [Theme: Sampression Lite] Filter matched posts

 *  [troelschristensen](https://wordpress.org/support/users/troelschristensen/)
 * (@troelschristensen)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/theme-sampression-lite-filter-matched-posts/)
 * Hi.
 * Thx for your great theme. You did/do a great job. I having some difficulties 
   in changing the multiple filter option, to show the posts the match ONLY the 
   selected categories.
 * Eg. If I select 2 categories, then I only want to se the posts that match
    - both
 *  categories and not the post from 1 category + the posts from the other category.
 * Hope, that you understand what I mean.
 * I found your note in the header.php, where you write, that you use som of the
   code from [http://isotope.metafizzy.co/docs/filtering.html](http://isotope.metafizzy.co/docs/filtering.html).
 * I also found the code as shown below in includes/functions.php.
 * **BUT I just don’t know how and where to start.**
 * Where can I change the code, so I get the BOTH as described here?
    [http://isotope.metafizzy.co/docs/filtering.html](http://isotope.metafizzy.co/docs/filtering.html)
 * _.metal.transition will show item elements that have BOTH .metal and .transition
   classes._
 * Thanks in advance.
 * Kind regards.
    Troels Christensen, Denmark
 * _[ Moderator Note: Please post code or markup snippets between backticks or use
   the code button. As it stands, your code may now have been permanently damaged/
   corrupted by the forum’s parser. [Or use pastebin.com instead](http://codex.wordpress.org/Forum_Welcome#Posting_Code).]_
 *     ```
       !-- Filter the Post by Category: We are using Isotop (http://isotope.metafizzy.co/) for Filtering: An exquisite jQuery plugin for magical layouts -->
       <?php if(is_home()): ?>
       <nav id="primary-nav">
         <div class="container">
         <a href="#">show/hide</a>
         <div class="columns sixteen">
           <div class="nav-label"><?php _e('Vis: ','sampression'); ?></div>
   
           <ul class="nav-listing clearfix">
   
       <li><a href="#"><span></span><?php _e('Alt','sampression'); ?></a></li>
               <?php
               $categories = get_categories();
               foreach($categories as $category):
               ?>
   
       <li><a href="void(0);">slug; ?>" id="<?php echo $category->slug; ?>" class="filter-data"><span></span><?php echo $category->name; ?></a></li>
               <?php
               endforeach;
               ?>
   
           <!-- Check Viewport: If the normal design couldn't fit with viewport, the Categories will appear via CSS with Select Menu form -->
           <select name="get-cats" id="get-cats">
               <option value="*">Show all</option>
               <?php
               foreach($categories as $category):
               ?>
               <option value=".<?php echo $category->slug; ?>"><?php echo $category->name; ?></option>
               <?php
               endforeach;
               ?>
           </select>
   
           </div>
         </div>
       </nav>
       <!-- #primary-nav -->
       ```
   
 * [http://wordpress.org/extend/themes/sampression-lite/](http://wordpress.org/extend/themes/sampression-lite/)

Viewing 1 replies (of 1 total)

 *  [mpaulusma](https://wordpress.org/support/users/mpaulusma/)
 * (@mpaulusma)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/theme-sampression-lite-filter-matched-posts/#post-3085372)
 * Hi there
 * I also love the theme but am trying to achieve the same thing as troelschristensen.
 * I am old school with SQL so I guess what I am trying to achieve is an ‘and’ filter
   rather than an ‘or’ filter.
 * I am just pitching in on the post in hope it will attract a solution.
 * Many thanks.

Viewing 1 replies (of 1 total)

The topic ‘[Theme: Sampression Lite] Filter matched posts’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/sampression-lite/2.3/screenshot.
   png)
 * Sampression Lite
 * [Support Threads](https://wordpress.org/support/theme/sampression-lite/)
 * [Active Topics](https://wordpress.org/support/theme/sampression-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/sampression-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/sampression-lite/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [mpaulusma](https://wordpress.org/support/users/mpaulusma/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/theme-sampression-lite-filter-matched-posts/#post-3085372)
 * Status: not resolved