Change URL

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4708
    kevin wuyts
    Participant

      Hi,

      Is it possible to change the URL?
      Now the url is http://www.example.com/wppizza/…
      I would like to change the wppizza to something generic, how can this be done?

      Regards

      #4730
      Olly
      Admin & Mod

        Hi

        for starters, this is only an issue really if you are actually linking to *single* menu items as – when using shortcodes/categories – the url will be whatever the page is named and the menu items will be displayed on that page according to the shortcode and/or category chosen

        if you do however link to single item pages (i assume you’ve edited the templates or using the search as – by default – there are no links to single menu items anywhere, you could use the inbuilt filter to change this in your themes function.php like so

        
        add_filter('wppizza_cpt_args','my_wppizza_cpt_arguments');
        function my_wppizza_cpt_arguments($args){
        /**change single item post slug from wppizza to myslug (should be translatable)**/
        $args['rewrite'] = array( 'slug' => __('myslug') );		
        return $args;
        }
        

        you will have to re-save your permalinks once

        having said that, i agree that this should be an option to set in the plugin, but until now I haven’t got round to it, as it wasn’t really required much. (as i mentioned , in most cases single item pages aren’t really necessary and on top of that you would have to mess around with single post templates to make this play nicely with your chosen theme)

        furthermore, the code above hasn’t really been tested as yet , so – at the moment – use it at your own risk as there might be something I have as yet overlooked that could screw things up….

        Either way, if you do use it , let me know if you experience any problems. I’ll do some testing myself which essentially would do the same thing except that it would be editable in the plugin itself.

        However 2 sets of eyes are better than one so any issues you find, let me know

        thanks

        #4732
        Olly
        Admin & Mod

          now be available as an option in wppizza->settings in v2.10.4

          #4784
          kevin wuyts
          Participant

            Thanks for adding the option in the settings, works fine.
            Always better than updating core files 🙂

          Viewing 4 posts - 1 through 4 (of 4 total)
          • The topic ‘Change URL’ is closed to new replies.