Using different parameters for different queries with pre get posts in functions.php
Using different parameters for different queries with pre get posts in functions.php
Using different parameters for different queries with pre get posts in functions.php
Two points: Your rule isn’t particularly specific. For numeric matches you should be specific about it and specify a) digits and b) how many digits. Year would be ([0-9]{4}), month/day would be ([0-9]{1,2}). You can’t do it with one rule. Add three separate rules instead. add_rewrite_rule( ‘whats-on/([0-9]{4})/?$’, ‘index.php?page_id=71&event_year=$matches[1]’,’top’); add_rewrite_rule( ‘whats-on/([0-9]{4})/([0-9]{1,2})/?$’, ‘index.php?page_id=71&event_year=$matches[1]&event_month=$matches[2]’,’top’); add_rewrite_rule( ‘whats-on/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$’, ‘index.php?page_id=71&event_year=$matches[1]&event_month=$matches[2]&event_day=$matches[3]’,’top’);
Is there a link parameter that will show me all my published pages?
Assign category to new post via URL
Probably WordPress gets “cat” as a category query and tries to load it. Tested in a project of mine and I also get a 404 error.
Adding parameters to password reset key
Rewrite custom post type URL parameters
I think Shortcodes with Parameters is what you’re looking for. https://developer.wordpress.org/plugins/shortcodes/shortcodes-with-parameters/
Better Answer: session_start(); $lead = $_GET[‘lead’]; $_SESSION[‘lead’] = $lead; Then, create an additional field on the form, with the input hidden. For the value, I would echo out the $_SESSION, with a name that is easy to grab (lead works). then, wherever the form is processed, just add a line to grab the lead, and … Read more
The init action… is one of many WordPress core action hooks. Hence it does not require, i.e. should not be accompanied by, a manual do_action call. You only need to manually run do_action for custom, previously non-existent, action hooks. Further, init is not the action which you want to hook the script enqueuing with. There … Read more