How do I create a dynamic page?

Here is the answer. And for future references, Deepak, you need to actually post the solution as an answer. Instead, you posted your answer within your own question and then made a comment about it. Please don’t do that. function analytics_rewrite_add_var( $vars ) { $vars[] = ‘analytic’; return $vars; } add_filter( ‘query_vars’, ‘analytics_rewrite_add_var’ ); function … Read more

WordPress keeps writing rewrite rules to .htaccess

I am not sure why this happens, but you can stop all write access to your .htaccess with a simple filter: add_filter( ‘flush_rewrite_rules_hard’, ‘__return_false’ ); Neither WordPress nor any plugins calling flush_rewrite_rules() will write something into the file now. Other methods to access and change the file will still work, for example insert_with_markers().

Change URL for Blog?

First, you need to change your Front Page settings: 1) Create a Static Page, called “Blog” (and a slug of “blog”) 2) Create another Static Page, to serve as your site Front Page 3) Go to Dashboard -> Settings -> Reading 4) Change “Front Page Displays” from “Your latest posts” to “A static Page (select … Read more

How to Change Author Posts URL

You can accomplish this with the following rewrite rule ( you’ll want to add this in your functions.php add_rewrite_rule( ‘author/([0-9]+)/?$’, ‘index.php?author=$matches[1]’, ‘top’ ); Be aware that you might need to flush your rules for it to become active. You can do this with rewrite plugin.

Rewrite Rule for Custom Page with Query Vars in URL

I manually deleted the .htaccess file and regenerated, which along with the code below, made the rewrite work. The second rewrite rule in the code below makes the pagination work properly. The .htaccess file doesn’t seem to be getting written with any rules though, but the rewrite is working now anyhow. function listen_rewrite_action() { add_rewrite_tag(‘%show%’,'([^/]*)’); … Read more

Why did installing wordpress in url root jack up underlying WP sites?

In each of the web.config files for each directory, they will look much like this: <rewrite> <rules> <rule name=”wordpress” stopProcessing=”true”> <match url=”*” /> <conditions> <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” /> <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” /> </conditions> <action type=”Rewrite” url=”index.php” /> </rule> </rules> </rewrite> For each sub-site, you need to change the rule name and add a … Read more

Author url rewrite

Assuming you are using custom post types for songs, books etc: function add_rewrite_rules($rules) { $newrules[‘author/([^/]+)/songs/?$’] = ‘index.php?post_type=songs&author=$matches[1]’; $newrules[‘author/([^/]+)/songs/page/?([0-9]{1,})/?$’] = ‘index.php?post_type=songs&locations=$matches[1]&paged=$matches[2]’; $rules = $newrules + $rules; return $rules; } function flushRules() { global $wp_rewrite; $wp_rewrite->flush_rules(); } add_filter(‘rewrite_rules_array’, ‘add_rewrite_rules’); /* This function should only really be run once per change of rules – comment out */ add_filter(‘init’,’flushRules’); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)