Tag Info

Hot answers tagged

1

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 ...


1

I believe this should handle it for you. Including monthly and daily. It also catches if you have defined a different rewrite slug than your custom post type slug. /* This function handles setting up Date archive rewrite rules for * ANY custom post type - You pass the CPT, and it will use the * re-written slug if applicable. */ function ...


1

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 ...


1

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');


1

There might be better ways using filters or apache/nginx rewrites, but here are two ideas to consider from the admin UI point of view (untested): Idea 1: You can always visit /wp-admin/options-general.php change the whole the site url: but I don't think you're looking for that, since this will also change the home url. Idea 2: You might therefore ...


1

$_GET refers literally to ?p=1 part of URL. With pretty permalink if it's empty then there is nothing to access. WordPress processed either case into query variables of WP_Query class. You should use get_query_var() to retrieve things like this, so in this specific case it would probably be get_query_var( 'p' ).



Only top voted, non community-wiki answers of a minimum length are eligible