Using permalinks with parameters

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

Loop 1 user randomly

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

YearMonth datequery

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

How to use endpoint, but remove/rewrite endpoint base?

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’ );

How to display a page dependent on a url parameter supplied by a form/button page?

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