Changing Permalinks for Default Post type to reflect navigation
If I remember right you can simply go to Settings > Permalinks and change Custom Structure to /news-events/current-news/%postname%/.
If I remember right you can simply go to Settings > Permalinks and change Custom Structure to /news-events/current-news/%postname%/.
Yes this is possible using the $wp->add_query_var function used together with add_rewrite_rule . Here you have an example: Passing and retrieving query vars in wordpress If you want more help here is a cut from one of my old plugins: function createRewriteRules() { global $wp_rewrite; $new_rules = array( ‘(.?.+?)/(stenskott)$’ => ‘index.php?pagename=”.$wp_rewrite->preg_index(2).”&ort=”. $wp_rewrite->preg_index(1), “(.?.+?)/(bilclas)$’ => ‘index.php?pagename=”.$wp_rewrite->preg_index(2).”&ort=”. … Read more
Well I figured it out myself. I just did a simple trick. I reset the plugin and deleted it. And downloaded a copy of it in the computer, extracted it. Opened the pie-register.php and piewpnun.php on notepad++ renamed all the “pie_veification” and wp-login” with find button. Then I again installed it and before activating it … Read more
The best way to do it is right before you display the options page. Right before your call to settings_fields, add this: if( isset( $_REQUEST[‘settings-updated’] ) ) flush_rewrite_rules(); Remove the flush_rewrite_rules from your other function and that should do the trick. Its worked for me.
Have you tried adding the third parameter to that call? add_rewrite_tag( ‘%make%’, ‘([^/]+)’, ‘make=” );
Instead of index.php/reco/?b=$1, try this: “$wp_rewrite->index?pagename=reco&b=” . $wp_rewrite->preg_index( 1 ) You should also append a $ to your reco/([^/]*)/? regex to ensure the rule only matches the entire path, and not just the beginning. Then flush your rules afterwards (just re-save your permalink settings in admin). Update: Try using the page_rewrite_rules filter instead, and use … Read more
From performance point of view what takes time is matching URL against generated (and stored persistently so it’s not rebuilt continuously) list of regular expressions. Since URLs are (most of the time) insignificantly short in text volume the amount of those regular expression rules has most impact on performance. Unless you generate unreasonably many rules. … Read more
It’s a pretty simple solution – WP_Query utilizes the name variable for posts and custom post type posts. It utilizes pagename for pages, hence why ?name=product1-faqs is not working. Use this instead: add_rewrite_rule(‘product1/faqs/?’, ‘index.php?pagename=product1-faqs’, ‘top’);
I found the correct url and patched the rewrite and it works perfectly now! This is what I ended with! add_rewrite_rule(‘^vehicle-make/([^/]*)/([^/]*)/?’,’index.php?vehicle-make=$matches[1]&sort=$matches[2]’,’top’);
There is an action hook called login_init. It’s also called on the registration page. You can simply attach wp_die() to it. You might want to disable the entire backend as well, which can be done by hooking into admin_init. add_action( ‘login_init’ , ‘wp_die’ ); add_action( ‘admin_init’ , ‘wp_die’ ); WordPress will exit with an empty … Read more