1

I am building a portfolio website in Wordpress. I have used the jquery plugin Isotope with the filtering for this. This works great when on the home page. However, once I click onto a post. I then need to be able to click on a filter and for it to goto the homepage but with the filter applied. My code is as follows:

HTML:

<ul class="filters">
    <li><a href="<?php echo site_url(); ?>/about-me">About Me</a></li>
    <li><a class="filter" href="" data-filter=".creative">Creative</a></li>
    <li><a class="filter" href="" data-filter=".social-strategy">Social Strategy</a></li>
    <li><a class="filter" href="" data-filter=".design">Design</a></li>
    <li><a class="filter" href="" data-filter=".websites">Websites</a></li>
    <li><a href="" class="active" data-filter="*">All</a></li>
</ul>

Javascript:

$('#filters a').click(function(){
      var selector = $(this).attr('data-filter');
      $container.isotope({ filter: selector });
      return false;
});

I did try this solution, which is exactly what I am trying to achieve: http://www.mcnab.co/blog/content-management-systems/jquery-isotope-filtering-results-for-url/ but it did not work for me.

My website only has two pages, the homepage(with the filter) and the post page. The filter controls are in the header.php file.

  • Hi Chris - that was my blog post. This answer here might help you further http://stackoverflow.com/questions/12604652/jquery-isotope-filter-from-different-page-wordpress It talks it through more and there's useful stuff in the comments. – McNab Mar 23 '13 at 21:28
  • That worked, I was missing the `href` in the links. Always something so silly! Thanks for your help. Great blog post. –  Mar 24 '13 at 17:41
  • No probs at all - glad it helped out and thanks for posting back that you resolved it! – McNab Mar 24 '13 at 23:53

0 Answers0