How to pass parameters thru URL?
How to pass parameters thru URL?
How to pass parameters thru URL?
If you are using wordpress, this guide might help you – https://developer.wordpress.org/reference/functions/add_image_size/
id is already used by WordPress, it’s a query variable and a reserved name. If you put ?id=5 on the end of a URL, you’re asking for the post with ID 5. Instead, have you considered using a person post type? This would give you an archive, add/edit screen, admin listings, templates, individual person templates, … Read more
Redirect based on $_GET parameters
I found where problem was – i can’t set other year. All i needed to do is to rename year parameter to something else – for example my_year.
I found a realy great solition here. !! It is a function that kindof ‘adds’ ‘orderby’ => ‘rand’ as a parameter. What it does it that when someone uses that parameter, the function will query the database using regular MySQL, where random is always possible 🙂 The function: // put this in your functions.php add_filter(‘pre_user_query’, … Read more
To search for posts based on date, you can set up a quick instance of WP_Query. The best place to look is the official documentation, and in particular the section on the date parameters. A basic search for posts in a particular month will look a little like this: <?php $the_query = new WP_Query( array( … Read more
I think the add_rewrite_rule is the correct route to go and I think what you have is correct also barring the Regex. Try substituting what you have currently for this => ^my-page\/([0-9]+)\/?. Full code below: function setup_filter_rewrites(){ add_rewrite_rule(‘^my-page\/([0-9]+)\/?’, ‘index.php?pagename=my-page&my_var=$matches[1]’, ‘top’); } add_action( ‘init’, ‘setup_filter_rewrites’ );
If you look at the documentation for add_action, you see that it accepts 4 parameters. The first 2 are required for adding any actions. If you want to change the priority of your action, you use the third parameter. If you want to change the number of arguments the function accepts, you use the fourth … Read more
If you would show pdf in content dynamically, which page would you like to show page, post or wherever. You have to echo your shortcode in template file. For example, you have to print like below <?php echo do_shortcode(“[shortcode pdf=”. $_REQUEST[“pdf_id’] .”); ?> http://yourwebsite.com/post-title/?pdf_id=20 //your url would be like that