Show one post per author and limit query to 8 posts

I believe that you can achieve this effect by grouping the query by author ID, which will require a filter(mostly cribbed from the Codex): function my_posts_groupby($groupby) { global $wpdb; $groupby = “{$wpdb->posts}.post_author”; return $groupby; } add_filter( ‘posts_groupby’, ‘my_posts_groupby’ ); If you have less than 8 authors, however, this won’t work. (You will get a number … Read more

Custom text box containing post titles

If you type “WordPress get recent posts” into Google you will see, right at the top of the list, wp_get_recent_posts. Follow that link and you will end up on that function’s “Function Reference” page in the Codex, where you will find, about halfway down, that someone has posted an example that does pretty much exactly … Read more

Related Posts loop – offset

Do you mean you want to display three blocks of four related posts, and flip between the three blocks using scrollable? If so, does the below help (not tested)? Assuming scrollable needs its content in separate divs, you could do something like this. It should produce a containing div with up to three divs inside, … Read more

meta_query not working properly

Based on the codex, the meta_query parameter contains one or more array with the relation parameter not set if single inner meta_query array. Also remove the page parameter as it serves only for a Static Front Page. Your args array should look like that: $archive_args = array( ‘post_type’ => ‘speight_home_plans’, ‘orderby’=> ‘title’, ‘order’ => ‘ASC’, … Read more

Add thumbnail to recent posts widget using filters

Here’s one way to do it through the the_title filter. We can limit the scope to the Recent Posts widget, by initialize it within the widget_posts_args filter and then remove it again after the loop. /** * Recent Posts Widget: Append Thumbs */ add_filter( ‘widget_posts_args’, function( array $args ) { add_filter( ‘the_title’, ‘wpse_prepend_thumbnail’, 10, 2 … Read more

Display all comments or recent comments per user on author page

your problem is using author_email, you need user_id: i just use similar script. <?php $args = array( ‘user_id’ => get_the_author_meta(‘ID’), ‘number’ => 10, // how many comments to retrieve ‘status’ => ‘approve’ ); $comments = get_comments( $args ); if ( $comments ) { $output.= “<ul>\n”; foreach ( $comments as $c ) { $output.= ‘<li>’; $output.= … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)