Changeset 606245
- Timestamp:
- 09/30/2012 06:45:38 PM (12 years ago)
- Location:
- cat-tag-filter-widget/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cat-tag-filter-widget/trunk/cat-tag-filter.php
r606089 r606245 5 5 Description: This plugin adds a widget to your WordPress site that allows your visitors to filter posts by category and tag. 6 6 Author: Ajay Verma 7 Version: 0.8. 17 Version: 0.8.2 8 8 Author URI: http://ajayver.com/ 9 9 */ … … 90 90 global $ctf_options, $current_tax; 91 91 92 93 94 $cat_args = array(95 'cat' => $current_tax[cats][0]96 );97 query_posts($cat_args);98 99 100 101 102 103 104 105 106 endif;107 108 if (!empty($tags)){92 if($current_tax[cats][0]){ 93 94 $cat_args = array( 95 'cat' => $current_tax[cats][0] 96 ); 97 query_posts($cat_args); 98 if(have_posts()): while (have_posts()) : the_post(); 99 $all_tag_objects = get_the_terms($post->ID, $ctf_options['tag_tax']); 100 if($all_tag_objects){ 101 foreach($all_tag_objects as $tag) { 102 if($tag->count > 0) $all_tag_ids[] = $tag->term_id; 103 } 104 } 105 endwhile; 106 endif; 107 $tags = array_unique($all_tag_ids); 108 109 109 if ($ctf_options['exclude_tags'] != ''){ 110 110 $ctf_options['exclude_tags'] = str_replace(" ", "", $ctf_options['exclude_tags']); 111 111 $exclude = explode(',', $ctf_options['exclude_tags']); 112 }112 113 113 114 114 if ($ctf_options['clude_tags'] == 'include') { … … 123 123 } 124 124 125 } 125 126 $include = substr($include, 0, -1); 126 127 $args['include'] = $include; 127 128 128 129 } 129 130 } 130 else { 131 132 $args[$ctf_options['clude_tags']] = $ctf_options['exclude_tags']; 133 134 } 135 136 137 138 139 131 140 $tags = get_terms($ctf_options['tag_tax'],$args); 132 141 -
cat-tag-filter-widget/trunk/readme.txt
r606088 r606245 5 5 Requires at least: 2.8 6 6 Tested up to: 3.4.2 7 Stable tag: 0.8. 17 Stable tag: 0.8.2 8 8 9 9 This plugin adds a widget to your WordPress site that gives your visitors an ability to filter all your posts by a category or/and tag. … … 74 74 == Changelog == 75 75 76 = 0.8. 1=76 = 0.8.2 = 77 77 * fixed a bug with tags including\excluding. 78 78
Note: See TracChangeset
for help on using the changeset viewer.