0

I'm trying to create a tabbed navigation, each tab containing 5 recent post excerpts of category items that are listed in a custom menu.

I'm planning to load all these posts at once and put each category in its own tab. I know how to get posts and navigation links separately but not how to make them work together..

Thanks for your help!

4

1 回答 1

0

因此,我设法通过将 WP 类别 slug 作为一个类添加到我的菜单项和我最近发布的每个类别概述页面上的每个类别的容器 div 来解决这个问题。

我使用 AJAX根据单击的菜单项将类别容器 div 加载到我的过滤器内容div 中。

$('.menu-item li').click(
        function () {                 
              //Category slug is the 5th class on my menu item
              var catName = jQuery(this)[0].className.split(' ')[4];
              //categories is my page url
              $('.filter-content').load('categories .' + catName);
   });

我希望有人会觉得这很有用!

于 2013-05-31T07:22:42.990 回答