• Resolved ltm2120

    (@ltm2120)


    I was having some issues setting up custom permalinks using the maps and location add on

    Basically what i am looking for it to remove the adverts_location and have url similar to one below. Where the url has the state/city with nothing before it and is dynamic based on each location

    Example URL

    mywebstite.com/state/city

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

    (@gwin)

    Hi,

    i do not know if you will be able to use the taxonomies without any prefix at all, this might be complicated as the WordPress router might get confused and redirect users incorrectly, so in very least a prefix like just “l” is recommended.

    To show the full path instead of term name you can add the below code in your theme functions.php file

    add_filter("wpadverts_mal_register_taxonomy", function($args, $type) {
      if($type != "advert_location") {
        return $args;
      }
      $args["rewrite"]["slug"] = "l";
      $args["rewrite"]["hierarchical"] = true;
      return $args;
    },10,2);

    Once you do that go to the wp-admin / Settings / Permalinks panel and click the “Save Changes” button to reset WP router and apply new URL scheme.

Viewing 1 replies (of 1 total)
  • The topic ‘PermaLink Structure Help – MAL’ is closed to new replies.