So I have a Wordpress page here:
http://12.ourgreenville.com/real_estate/
I want to be able to place two variable (city/state) in the URL, then work with them. A URL would look like this:
http://12.ourgreenville.com/real_estate/1/2/
Please let me know what is needed. I placed your code in functions.php as follows:
function add_rewrite_rules( $wp_rewrite )
{
$new_rules = array(
'('.$template_page_name.')/real_estate/(.*?)/?([0-9]{1,})/?$' =>'index.php?p=5351city='.$wp_rewrite->preg_index(1).'&state='.$wp_rewrite->preg_index(2)
);
$wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
}
add_action('generate_rewrite_rules', 'add_rewrite_rules');
function query_vars($public_query_vars) {
$public_query_vars[] = "city";
$public_query_vars[] = "state";
return $public_query_vars;
}
add_filter('query_vars', 'query_vars');
I don't know what i am doing wrong.kindly help me.