• Resolved alysiacaringi

    (@alysiacaringi)


    Hi,

    When I try to add my custom taxonomy, it doesn’t show up and all of my other taxonomies disappear. My taxonomy is called “categoryexpert” and this is the code I’m using:

    function my_taxonomy_types($taxonomies) {
        $taxonomies[] = 'categoryexpert';
        return $taxonomies;
    }
    add_filter('s2_taxonomies', 'categoryexpert');

    am I doing something wrong?

    Thanks!

    https://www.ads-software.com/plugins/subscribe2/

Viewing 2 replies - 1 through 2 (of 2 total)
  • @alysiacaringi

    There is an error in your code. You have defined the function correctly but on the ‘add_filter()’ line you must tell the function which hook you are filtering (in this case the ‘s2_taxonomies’ filter) and then pass in the name of the function that carries out the filtering (in this case ‘my_taxonomy_types’).

    So, the corrected add_filter line ould be this:
    add_filter('s2_taxonomies', 'my_taxonomy_types');

    Thread Starter alysiacaringi

    (@alysiacaringi)

    Thank you so much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Taxonomies not showing up’ is closed to new replies.