Could someone correct this plugin’s code?
-
Hi,
I’m building an articles directory site using the “Articles Directory” plugin and theme and one of the suggested add-on plugins is giving me a 404 error.
Could someone please have a look at the code to see what’s wrong with it? I would like to have it running in a 2.5.1 environment (in a sub folder) and using pretty permalinks.
<?php /* Plugin Name: Kinderlose Plugin URI: https://guff.szub.net/kinderlose Description: Remove posts from child categories in (parent) category queries. Version: R1 Author: Kaf Oseo Author URI: https://szub.net Copyright (c) 2007 Kaf Oseo (https://szub.net) Kinderlose is released under the GNU General Public License (GPL) https://www.gnu.org/licenses/gpl.txt This is a WordPress 2.3 plugin (https://www.remarpro.com). Inspired by Michael D. "mdawaffe" Adams' Just One Category and Rich Hamilton's No SubCats. */ function kinderlose_where($where) { if ( is_category() ) { global $wp_query; $where = preg_replace('/.term_id IN \(\'(.*)\'\)/', '.term_id IN (\'' . $wp_query->query_vars['cat'] . '\') AND post_type = \'post\'', $where); } return $where; } add_filter('posts_where', 'kinderlose_where'); ?>
Thanks,
Gene
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Could someone correct this plugin’s code?’ is closed to new replies.