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