How can we help?

If you are looking for support for our PokaTheme, this is the place!

Home Forums PokaTheme support How to remove review category pages

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #13593
    Harri
    Participant

    Hello,

    I want to use categories on listing the casinos but I would like that people wouldnt see the category pages because it competes with my other pages keywords. So when I create a new category, there will be url “mypage.com/list/category-name” and I dont want people or google to see it.

    #13594
    admin
    Keymaster

    Hi Harri,

    As you want to make your taxonomy private, please check the snippet below:

    add_filter( 'register_taxonomy_args', 'change_slug_affiliates_tax', 10, 2 );
    function change_slug_affiliates_tax( $args, $taxonomy ) {
    
        if ( $taxonomy == 'lists') {
            $args['public'] = false;
        }
    
        return $args;
    }
    
    #13598
    Harri
    Participant

    Hello and thank you,

    Might be a bit stupid question but where should i add that? 😀

    #13617
    admin
    Keymaster

    We suggest to use the child theme that comes with your PokaTheme product.
    Then you can add the snippet above to functions.php of the child theme.

    #13678
    Harri
    Participant

    Hi,

    I added snippets plugin and added the code you asked. The category pages removed as I wished but now all the review tables has all the casinos. Not only the category there use to be.

    I meaan i want to use the categories on the review tables but i just dont want the new urls such as example.com/list/newCasinos

    How can I still use categories on the website?

    #13876
    admin
    Keymaster

    Hi Harri,

    Please try to replace the previous snippet with this one:

    add_action( 'pre_get_posts', function( $query ) {
    
        if ( is_admin() ) return;
    
        if ( is_tax( 'lists' ) ) {
            wp_redirect( get_bloginfo('url') );
        }
    
    }

    What this snippet does is to check if you are in the category page, and if you do, it redirects you to the home page. The review tables are not affected at all.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.