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.