List Authors For Current Category

Execution of code goes to infinite loop because you missed the_post() in loop. You can list all authors from current category:- Create an empty array for author IDs Check if current author ID exist in that array If No, display the author name and store that author ID in array. If Yes, Then skip that … 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

Attachment Metadata inside of Loop

Here’s the fix. All the attachment info is now being called inside the php using wp_prepare_attachment_for_js and the info will load for each image in the loop, to display in the photo gallery. It works now. <?php $the_query = new WP_Query(array( ‘post_type’ => ‘attachment’, ‘post_status’ => ‘inherit’, ‘category_name’ => ‘arch’ )); while ( $the_query->have_posts() ) … Read more

Querying posts from only one category and exluding the latest post

Try this code global $myOffset; $myOffset = 1; $paged = get_query_var(‘paged’) ? get_query_var(‘paged’) : 1; //Use ‘page’ instead of ‘paged’ if you are on home page $args = array( ‘post_type’ => ‘post’, ‘cat’=> 1, //Selecting post category by ID to show ‘posts_per_page’ => 4, //No. of posts to show ‘offset’ => $myOffset, //Eexcluding latest post … Read more