WordPress.org

Ready to get started?Download WordPress

Forums

Sampression Lite
Filter matched posts (2 posts)

  1. troelschristensen
    Member
    Posted 1 year ago #

    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.

    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

    .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. ]

    !-- 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/

  2. mpaulusma
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic