tbird12
Forum Replies Created
-
Forum: Plugins
In reply to: [Facetious] Displaying taxonomy filters hierarchicallyDoes this do what you want?:
$term->name = str_repeat('- ',$depth).$term->name.' ('.$term->count.')';But, that won’t work if you have sub-sub cats, where you just want one dash even when a cat is 2 or more deep.
Oh! My original code should have &-n-b-s-p-; where it shows a space. But, it doesn’t show. I just noticed that.
Forum: Plugins
In reply to: [Facetious] Displaying taxonomy filters hierarchicallyTed,
Whatever character you want for the indent, put in place of the ‘ ‘ in this line in my code:
$term->name = str_repeat(‘ ‘,$depth*4).$term->name.’ (‘.$term->count.’)’;If you want a dash, use:
$term->name = str_repeat(‘-‘,$depth*4).$term->name.’ (‘.$term->count.’)’;Forum: Plugins
In reply to: [Author Post Ratings] list post by stars+1 for this feature.
Forum: Plugins
In reply to: [Facetious] Displaying taxonomy filters hierarchicallyI made the category drop-down hierarchical, with counts for categories and tags, with these mods to template.php:
Look for:
# Taxonomy dropdown:Replace the $terms = get_terms… with:
$terms = get_terms( $key, array( 'hide_empty' => true, 'pad_counts' => true ) ); sort_terms_hierarchy($terms);Then add this sort_terms_hierarchy function somewhere:
function sort_terms_hierarchy(Array &$terms) { $result = array(); $parent = 0; $depth = 0; $i = 0; do { $temp = array(); foreach($terms as $j => $term) { if ($term->parent == $parent) { $term->depth = $depth; $term->name = str_repeat(' ',$depth*4).$term->name.' ('.$term->count.')'; array_push($temp, $term); unset($terms[$j]); } } array_splice($result, $i, 0, $temp); $parent = $result[$i]->term_id; $depth = $result[$i]->depth + 1; } while ($i++ < count($result)); $terms = $result; }Forum: Plugins
In reply to: [Facetious] Facetious with WPSearchThe fault is with WPSearch, not Facetious. WPSearch doesn’t handle categories correctly, and doesn’t support tags at all. So, I had to remove WPSearch.
Forum: Plugins
In reply to: [Facetious] Facetious with WPSearchCan you explain how and where in the php that Facetious hooks in to the search function?