Rewire Rules Front Page
Rewire Rules Front Page
Rewire Rules Front Page
[] = not [] .= to append to an array. function custom_query_vars_filter($vars) { $vars[] = ‘ae_issues’; $vars[] = ‘issueloc’; $vars[] = ‘issuearea’; return $vars; } Another trick, if you don’t want to mess with a query is to change these vars to something like _issueloc & _issuearea. I found making custom queries as flags is … Read more
If the data is coming from a third-party, then putting rules into the Permalinks section of the WP admin panel won’t work. You’ll need to write some code to register your own URL parameter(s) for the pagination, in order to achieve clean URLs. First, you need to register the parameter, I suggest not calling it … Read more
Social sharing conflict with Rewrite rules
Here is my current code: function hm_base_date_query_vars($vars) { $vars[] = ‘base_date’; return $vars; } add_filter(‘query_vars’, ‘hm_base_date_query_vars’); function hm_base_date_rewrite_rule() { add_rewrite_rule( ‘^my-calendar/([^/]*)/?’, ‘index.php?pagename=my-calendar&base_date=$matches[1]’, ‘top’ ); } add_action(‘init’, ‘hm_base_date_rewrite_rule’, 10, 0); $base_date_test = get_query_var(‘base_date’); on the url example.com/my-calendar/foo my var $base_date_test returns null Maybe someone can help me. Thanks. // Edit: It works. I tried to call … Read more
Try this add_filter( ‘rewrite_rules_array’, function( $rules ) { $new_rules = array( ‘services/([^/]*?)/page/([0-9]{1,})/?$’ => ‘index.php?product_cat=$matches[1]&paged=$matches[2]’, ‘services/([^/]*?)/?$’ => ‘index.php?product_cat=$matches[1]’, ‘services/([^/]*?)/([^/]*?)/?$’ => ‘index.php?product_cat=$matches[2]’ ); return $new_rules + $rules; } );
Look at the rewrite_rules option in the wordpress database’s option table. I bet your answer is end point.
I would think that .com/genre/comedy is actually picked up by the second rule since it matches that as well, and because it is added first I think it takes precedence. You could try to swap the order, so it goes 3, 4, 1, 2. For production, you might want to remove flush_rewrite_rules();, I believe it’s … Read more
Adding Custom Taxonomy Along-with Post Name in Post Type Permalink
Turns out it was just really Friday for me. Thanks to @eddiemoya and @matt-keys for their answers on this question. Their answer helped me a lot. After their explanation I revisited the WordPress documentation and it really wasn’t that hard to comprehend. The solution I user for my specific question was as follows: I created … Read more