用wordpress按类别进行同位素过滤 [英] Isotope filtering with wordpress by categories
问题描述
我正在使用metafizzy脚本编写的同位素,需要在我的网站的项目页面上使用它,它工作正常,但是我想做的是按自定义帖子类别(投资组合类别)进行过滤,这是该项目页面上的代码:
I am using the isotope by metafizzy script, need to use it on projects page of my website, it's working fine but what i want to do is filtering by custom post categories (portfolio categories), here's the code on that project page:
<div id="aside">
<ul id="subMenu" class="accordionMenu" data-option-key="filter">
<li class="dcjq-parent-li">
<a href="#" class="dcjq-parent active">Tipologia<span class="dcjq-icon"></span>
</a>
<ul style="display: block;">
<li><a href="#filter" data-filter="*" class="active">todos</a></li>
<li><a href="#filter" data-filter=".residencial">Residencial</a></li>
<li><a href="#filter" data-filter=".comercial">Comercial</a></li>
<li><a href="#filter" data-filter=".cultural">Cultural</a></li>
<li><a href="#filter" data-filter=".interiores">Interiores</a></li>
</ul>
</li>
<li class="dcjq-parent-li">
<a href="#" class="dcjq-parent">Datas<span class="dcjq-icon"></span></a>
<ul style="display: none;">
<li><a href="#filter" data-filter="*" class="actv">todos</a></li>
<li><a href="#filter" data-filter=".1980, .1981, .1982, .1983, .1984">1980 - 1984</a></li><li><a href="#filter" data-filter=".1985, .1986, .1987, .1988, .1989">1985 - 1989</a></li><li><a href="#filter" data-filter=".1990, .1991, .1992, .1993, .1994">1990 - 1994</a></li><li><a href="#filter" data-filter=".1995, .1996, .1997, .1998, .1999">1995 - 1999</a></li><li><a href="#filter" data-filter=".2000, .2001, .2002, .2003, .2004">2000 - 2004</a></li><li><a href="#filter" data-filter=".2005, .2006, .2007, .2008, .2009">2005 - 2009</a></li><li><a href="#filter" data-filter=".2010, .2011, .2012, .2013, .2014">2010 - 2014</a></li>
</ul>
</li>
</ul>
</div>
这是过滤器代码的链接,我在其中添加了类
http://goo.gl/y4cXLB
我想做的是做一个自定义循环或php函数,这样我就可以将类别项显示为同位素过滤器.另外,如果这是一个简单的选择,我想使用标签来过滤具有同位素的帖子.
我在wordpress函数和php方面不擅长,我通过Web和同位素教程进行了所有集成,jQuery以正确的方式实现.
我需要帮助来过滤帖子类别或某些功能的简单解决方案.
Here's the link to filters code, where i added the classes
http://goo.gl/y4cXLB
What i want to do is, to do a custom loop or php function so i can display the categories items as isotope filters. Alternatively i would like to use the tags to filter the posts with isotope, if that's an easy option.
I am not good in wordpress functions and php, i did the all integration by the tutorials on web and isotope, jquery is implemented in right way.
I need the help to filter the post categories, or some function, easy solution.
推荐答案
有一个适用于wordpress的同位素插件: http://mintthemes.com/isotope-for-wordpress/
There is a isotope plugin for wordpress: http://mintthemes.com/isotope-for-wordpress/
如果您想自己集成同位素(具有类别过滤功能),这些教程(第1部分和第2部分)将引导您完成该过程.
If you want to integrate isotope (with category filtering) yourself these tutorials (part 1 and 2) walk you through the process.
第1部分: http://www.aliciaramirez.com/2014/03/integrating-isotope-with-wordpress/
第2部分: http://www.aliciaramirez.com/2014/07/integrate-isotope-with-wordpress-part-2-categories/
这篇关于用wordpress按类别进行同位素过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!