Forum Replies Created

Viewing 1 replies (of 1 total)
  • YARPP is a great plugin and I am very happy about the new templates feature in 3.0, but I too was looking to be able to use the new custom taxonomies in WordPress 2.8.

    I dug into the YARPP code in the plugin folder and made two tiny tweaks to the SQL queries in magic.php and services.php that seem to make this work.

    Definitely make a backup copy of magic.php and services.php before you do this in case anything breaks.

    In services.php on line 26 the original code should look like this,

    foreach ($wpdb->get_results("select $wpdb->terms.term_id, name from $wpdb->terms natural join $wpdb->term_taxonomy where $wpdb->term_taxonomy.taxonomy = 'post_tag' order by name") as $tag) {

    To add your own custom taxonomies to it change it to look like this,

    foreach ($wpdb->get_results("select $wpdb->terms.term_id, name from $wpdb->terms natural join $wpdb->term_taxonomy where $wpdb->term_taxonomy.taxonomy in ('post_tag', 'custom_taxonomy_slug') order by name") as $tag) {

    where ‘custom_taxonomy_slug’ would be the all lowercase slug of your custom taxonomy. For example, if you created a custom taxonomy called People so you could add tags like Johnny, Peter, or Lisa to the People taxonomy, then you would add ‘people’ as your custom_taxonomy_slug.You could as many different slugs here separated by commas.

    The last change is in magic.php on line 186.

    Change this line

    AND tagtax.taxonomy = 'post_tag')\n";

    to look something like this

    AND (tagtax.taxonomy = 'post_tag' OR tagtax.taxonomy = 'custom_taxonomy_slug'))\n";

    Again, the ‘custom_taxonomy_slug’ would be the same slug name you used in the first change.

    If everything works you should see your custom taxonomy tags show up in the YARPP settings page in the “Disallow by tag” section.

Viewing 1 replies (of 1 total)