Need help with regex
It’s not understandable for me, but the second definition works now. No idea, why it didn’t work before, but I guess, somewhere I made a small mistake. Sorry, for my useless post 😉
It’s not understandable for me, but the second definition works now. No idea, why it didn’t work before, but I guess, somewhere I made a small mistake. Sorry, for my useless post 😉
Add additional URL variations for a Post
get_query_var() gets variables from the main instance of WP_Query. It’s the equivalent of running global $wp_query; $wp_query->get( ‘posts_per_page’ ); It is not directly related to $_GET in any way. However, WordPress has a list of ‘public’ query variables that will be applied to the main query if they are passed as URL parameters. This is … Read more
Inside get_posts() of WP_Query class, you will see this code block. /* * Ensure that ‘taxonomy’, ‘term’, ‘term_id’, ‘cat’, and * ‘category_name’ vars are set for backward compatibility. */ if ( ! empty( $this->tax_query->queried_terms ) ) { /* * Set ‘taxonomy’, ‘term’, and ‘term_id’ to the * first taxonomy other than ‘post_tag’ or ‘category’. */ … Read more
First, adding a rewrite tag and a query var is redundant, adding the tag adds the query var. Second, $matches corresponds to each regex pattern you have in your rule, so it should be $matches[1] and $matches[2], not 2 and 4. Last, for a single member, you can just set the member query var. add_rewrite_rule( … Read more
Nothing in $_GET will be set for internal rewrite rules, that’s not how they work. Look in the query vars for idx-action– either get_query_var(‘idx-action’) or $wp_query->query_vars[‘idx-action’].
Passing query variables to a custom page template
passing javascript variable into php wordpress
You can always check the value of the result with the function var_dump as follows: var_dump( $matches[1] ); In this case, I think is returning an Array with the results you should try to out. <?php echo $matches[1][0] ; ?>
Query var SEO URL