Skip to main content

You rewrite rule is quite boardbroad and it will, for sure, generates most likely generate a lot of conflicts.

add_action('init', 'dcc_rewrite_tags');
function dcc_rewrite_tags() {
    add_rewrite_tag('%propref%', '([^&]+)');
}

add_action('init', 'dcc_rewrite_rules');
function dcc_rewrite_rules() {
    add_rewrite_rule('^cottage-details/(.+)/?$','index.php?page_id=2&propref=$matches[1]','top');
}

Then you can access to propref query var like:

$propref = get_query_var( 'propref' );

And remember to flush the rewrite rules; you can do it by going to Settings -> Permalinks and clicking on save button.

Note: changed p query var to page_id because, as you said in the comments, you are using a page, not a standard post.

You rewrite rule is quite board and it will, for sure, generates a lot of conflicts.

add_action('init', 'dcc_rewrite_tags');
function dcc_rewrite_tags() {
    add_rewrite_tag('%propref%', '([^&]+)');
}

add_action('init', 'dcc_rewrite_rules');
function dcc_rewrite_rules() {
    add_rewrite_rule('^cottage-details/(.+)/?$','index.php?page_id=2&propref=$matches[1]','top');
}

Then you can access to propref query var like:

$propref = get_query_var( 'propref' );

And remember to flush the rewrite rules; you can do it by going to Settings -> Permalinks and clicking on save button.

Note: changed p query var to page_id because, as you said in the comments, you are using a page, not a standard post.

You rewrite rule is quite broad and will most likely generate a lot of conflicts.

add_action('init', 'dcc_rewrite_tags');
function dcc_rewrite_tags() {
    add_rewrite_tag('%propref%', '([^&]+)');
}

add_action('init', 'dcc_rewrite_rules');
function dcc_rewrite_rules() {
    add_rewrite_rule('^cottage-details/(.+)/?$','index.php?page_id=2&propref=$matches[1]','top');
}

Then you can access to propref query var like:

$propref = get_query_var( 'propref' );

And remember to flush the rewrite rules; you can do it by going to Settings -> Permalinks and clicking on save button.

Note: changed p query var to page_id because, as you said in the comments, you are using a page, not a standard post.

added 125 characters in body
Source Link
cybmeta
  • 20.6k
  • 5
  • 47
  • 56

You rewrite rule is quite board and it will, for sure, generates a lot of conflicts.

add_action('init', 'dcc_rewrite_tags');
function dcc_rewrite_tags() {
    add_rewrite_tag('%propref%', '([^&]+)');
}

add_action('init', 'dcc_rewrite_rules');
function dcc_rewrite_rules() {
    add_rewrite_rule('^cottage-details/(.+)/?$','index.php?page_id=2&propref=$matches[1]','top');
}

Then you can access to propref query var like:

$propref = get_query_var( 'propref' );

And remember to flush the rewrite rules; you can do it by going to Settings -> Permalinks and clicking on save button.

Note: changed p query var to page_id because, as you said in the comments, you are using a page, not a standard post.

You rewrite rule is quite board and it will, for sure, generates a lot of conflicts.

add_action('init', 'dcc_rewrite_tags');
function dcc_rewrite_tags() {
    add_rewrite_tag('%propref%', '([^&]+)');
}

add_action('init', 'dcc_rewrite_rules');
function dcc_rewrite_rules() {
    add_rewrite_rule('^cottage-details/(.+)/?$','index.php?page_id=2&propref=$matches[1]','top');
}

Then you can access to propref query var like:

$propref = get_query_var( 'propref' );

And remember to flush the rewrite rules; you can do it by going to Settings -> Permalinks and clicking on save button.

You rewrite rule is quite board and it will, for sure, generates a lot of conflicts.

add_action('init', 'dcc_rewrite_tags');
function dcc_rewrite_tags() {
    add_rewrite_tag('%propref%', '([^&]+)');
}

add_action('init', 'dcc_rewrite_rules');
function dcc_rewrite_rules() {
    add_rewrite_rule('^cottage-details/(.+)/?$','index.php?page_id=2&propref=$matches[1]','top');
}

Then you can access to propref query var like:

$propref = get_query_var( 'propref' );

And remember to flush the rewrite rules; you can do it by going to Settings -> Permalinks and clicking on save button.

Note: changed p query var to page_id because, as you said in the comments, you are using a page, not a standard post.

added 6 characters in body
Source Link
cybmeta
  • 20.6k
  • 5
  • 47
  • 56

You rewrite rule is quite board and it will, for sure, generates a lot of conflicts.

add_action('init', 'dcc_rewrite_tags');
function dcc_rewrite_tags() {
    add_rewrite_tag('%propref%', '([^&]+)');
}

add_action('init', 'dcc_rewrite_rules');
function dcc_rewrite_rules() {
    add_rewrite_rule('^cottage-details/(.+)/?$','index.php?p=2&propref=$matches[1]'page_id=2&propref=$matches[1]','top');
}

Then you can access to propref query var like:

$propref = get_query_var( 'propref' );

And remember to flush the rewrite rules; you can do it by going to Settings -> Permalinks and clicking on save button.

You rewrite rule is quite board and it will, for sure, generates a lot of conflicts.

add_action('init', 'dcc_rewrite_tags');
function dcc_rewrite_tags() {
    add_rewrite_tag('%propref%', '([^&]+)');
}

add_action('init', 'dcc_rewrite_rules');
function dcc_rewrite_rules() {
    add_rewrite_rule('^cottage-details/(.+)/?$','index.php?p=2&propref=$matches[1]','top');
}

Then you can access to propref query var like:

$propref = get_query_var( 'propref' );

And remember to flush the rewrite rules; you can do it by going to Settings -> Permalinks and clicking on save button.

You rewrite rule is quite board and it will, for sure, generates a lot of conflicts.

add_action('init', 'dcc_rewrite_tags');
function dcc_rewrite_tags() {
    add_rewrite_tag('%propref%', '([^&]+)');
}

add_action('init', 'dcc_rewrite_rules');
function dcc_rewrite_rules() {
    add_rewrite_rule('^cottage-details/(.+)/?$','index.php?page_id=2&propref=$matches[1]','top');
}

Then you can access to propref query var like:

$propref = get_query_var( 'propref' );

And remember to flush the rewrite rules; you can do it by going to Settings -> Permalinks and clicking on save button.

edited body
Source Link
cybmeta
  • 20.6k
  • 5
  • 47
  • 56
Loading
added 98 characters in body
Source Link
cybmeta
  • 20.6k
  • 5
  • 47
  • 56
Loading
Source Link
cybmeta
  • 20.6k
  • 5
  • 47
  • 56
Loading