tuftsceeo / smartpost

SmartPost is a dynamic templating and authoring tool that brings a lot of the features of the WordPress dashboard to the front end.
1 stars 4 forks source link

sp-post-tree widget: limit posts to direct parent category #43

Closed rafiyagi closed 10 years ago

rafiyagi commented 10 years ago

Added the following to buildCatDynaTree() to limit posts to their direct parent categories:

#!php

                $child_cats = (array) get_term_children($category->term_id, 'category');
                $postArgs = array_merge( $postArgs, array( 'category' => $category->term_id, 'category__not_in' => array_merge( $child_cats ) ) );

rafiyagi commented 10 years ago
#!php

                $child_cats = (array) get_term_children($category->term_id, 'category');
                $postArgs = array_merge( $postArgs, array( 'category' => $category->term_id, 'category__not_in' => array_merge( $child_cats ) ) );

Original Comment By: Rafi Yagi