Tag Info

New answers tagged

1

You can use rewrite arg in register_post_type. You can have custom post type name different then rewrite slug. For example here is the sample code with custom post type project and it shows pages with http://shaowtriger.com/brands/naim/ Notice rewrite in $args add_action( 'init', 'codex_brand_init' ); function codex_brand_init() { $labels = array( ...


0

ok this i didn't know i had to "register" variable to use function my_add_rewrite_rules() { global $wp,$wp_rewrite; $wp->add_query_var('book_id'); add_rewrite_rule('^books/([^/]*)/reviews/([0-9]+)/?$', 'index.php?page_id=227&bookid_id=$matches[2]', 'top'); // Once you get working, remove this next line ...


0

You have to make your rewrite rules account for the paged parameter, because otherwise they won't. It would look somewhat like shown below. function test_add_rewrite_rules() { add_rewrite_rule( 'businesses/(eat|stay|play)/(.+)/page/([0-9]+)/?$', ...


0

While it's possible to get rid of WP_Query in WP load process it's pretty horribly inconvenient to accomplish. :) Let's recap the process as related to rewrite: Web server takes pretty permalink and rewrites it to WP's index.php. WP takes "pretty" part and applies its rewrite rules to it, turning it into query variables. Query variables are processed and ...


0

Have you tried adding the third parameter to that call? add_rewrite_tag( '%make%', '([^/]+)', 'make=' );


2

I'm not sure but I think that you just need to add two query vars, "group" and "value", not two rewrite tags. Can you try this: add_filter('query_vars', 'cyb_add_query_vars'); function cyb_add_query_vars( $vars) { $vars[] = "group"; // name of the var as seen in the query string and URL $vars[] = "value"; return $vars; } ...



Top 50 recent answers are included