Support » Plugin: WPAdverts - Classifieds Plugin » Category URL

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    you can change the “advert-category” to something else but not removed as most likely this will conflict with WordPress router which will not be able to properly resolve the URLs.

    To change the “advert-category” to for example “my-category” you can add the code below in your theme functions.php file

    
    add_action("adverts_register_taxonomy", "customize_adverts_taxonomy", 10, 2 );
    function customize_adverts_taxonomy( $args, $type = null ) {
        if( $type != "advert_category" ) {
            return $args;
        }
        
        if(!isset($args["rewrite"])) {
            $args["rewrite"] = array();
        }
       
        $args["rewrite"]["slug"] = "my-category";
        return $args;
    }
    

    Thanks you !

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