• Resolved webam

    (@webam)


    Hello, I’ll ask you the same question I posted to you yesterday.

    I have to replace these two slugs, in Italian.

    advert-category
    advert-location

    How do it?

    https://ibb.co/zFBvrZ6
    https://ibb.co/P16W2VQ

    • This topic was modified 6 years, 1 month ago by webam.
    • This topic was modified 6 years, 1 month ago by webam.
    • This topic was modified 6 years, 1 month ago by webam.
    • This topic was modified 6 years, 1 month ago by webam.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    You can do that using adverts_register_taxonomy and wpadverts_mal_register_taxonomy filters

    
    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"] = "ad-category";
        return $args;
    }
    add_action("wpadverts_mal_register_taxonomy", "customize_location_taxonomy", 10, 2 );
    function customize_location_taxonomy( $args, $type = null ) {
        if( $type != "advert_location" ) {
            return $args;
        }
        if(!isset($args["rewrite"])) {
            $args["rewrite"] = array();
        }
        $args["rewrite"]["slug"] = "ad-location";
        return $args;
    }
    

    See https://github.com/simpliko/wpadverts-snippets/blob/master/custom-slugs/custom-slugs.php for more details.

    Thread Starter webam

    (@webam)

    Fantastic that work PERFECT ??

    to reach the perfection that I would like, it would be only possible to add the category and location to the permalink of the individual ads. For example

    https://www.annuncigratuiti.com/category/post-title/location/id post.html

    Is it possible that in anyway? I try but I can not understand how to work with the plug-in plugin :'(

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How change advert-category and advert-location slug’ is closed to new replies.