Use Regular Expression to get tag from permalink url during wp_rewrite in generate_rewrite_rules
Replace (.*) with (.*?). The question mark makes it ‘lazy’. Also, replace ([0-9]{4}) with (\d+). See http://www.regular-expressions.info/reference.html
Replace (.*) with (.*?). The question mark makes it ‘lazy’. Also, replace ([0-9]{4}) with (\d+). See http://www.regular-expressions.info/reference.html
For those of you without the required sql knowledge. The steps below can be used to change your main site url variable on a network installation. Assumption: Windows Operating system MySQL Admin basic tasks WinGrep Steps: Download mysql dump.sql of your full wordpress database While using wingrep find all matches for @url then replace with … Read more
First, your additional line comes too late. The rule before catches everything you want to match. Second, it doesn’t what you want. Your … RewriteRule /([0-9]+/?)$ /about/latest-news/$1 [NC,L] … matches requests like example.com//0000000000000000000/ or example.com/about/latest-news/2010/ (infinite loop!). The first argument for RewriteRule omits the starting /. To match year archives you need rather: RewriteRule ^(\d\d\d\d)/?$ … Read more
This is not a WordPress question. Anyway … RewriteRule ^blog/(.*) /$1 [L,R=301]
Once way of doing it – I am sure there are other ways too – is to make a page template for books: books.php You can make a copy of page.php and rename it. In the top of the file you place the usual Page Template code as in: <?php /* Template Name: Books */ … Read more
There’s a codex on this issue here: http://codex.wordpress.org/Creating_a_Static_Front_Page I haven’t been provided all the details of your site from your post. As in what your original site root is from when you installed it. So i’m making an assumption that this is a new install.
The answer to the question is in the two following posts: Permalinks in Custom Post types Remove taxonomy slug from a custom hierarchical taxonomy permalink You need to ignore the automated rewriting, as I have done, but you need to add $wp_rewrite->use_verbose_page_rules = true; to the mix, otherwise your pages will conflict with the rewrite … Read more
Unless you declare $wp_rewrite as a global in your test function, you’ll be trying to access the local variable $wp_rewrite. This, of course, won’t work. Add the line global $wp_rewrite;: <?php add_action(‘init’, ‘test’); function test() { global $wp_rewrite; $reply_struct=”/reply/%reply_id%”; $wp_rewrite->add_rewrite_tag(‘%reply_id%’, ‘([^/]+)’, ‘reply_id=$matches[1]’); $wp_rewrite->add_permastruct(‘reply_id’, $reply_struct, false); }
I think this answer could help you. Make a custom page template within your plugin and then create a page with that template called Blackout, and redirect users in the plugin to that page. Help from: Create custom page templates with plugins? Edit with code sample: Say you have a page called Blackout, the slug … Read more
What you will want to use is get_query_var( ‘paged’ ). This will get the default pagination value, this should be set by default, so you should just be able to plug and play. Because there are no URL parameters due to rewriting, $_GET[] will be completely empty (at least on the example URLs).