How to display latest posts with authors image

You could try something like this: <?php $args = array( ‘category’ => 12, ‘post_type’ => ‘post’ ); $postslist = get_posts( $args ); foreach ($postslist as $post) : setup_postdata($post); ?> <h2><a href=”https://wordpress.stackexchange.com/questions/318848/<?php the_permalink(); ?>”><?php the_title(); ?></a></h2> <h4><?php the_author();?></h4> <?php the_excerpt(); echo get_avatar(get_the_author_meta()); endforeach; ?> In the example the category id is set to 12 – just … Read more

Remove dashboard links from wordpress

you should follow the below code and also see the wordpress docs <?php function remove_menus(){ remove_menu_page( ‘index.php’ ); //Dashboard //remove_menu_page( ‘jetpack’ ); //Jetpack* //remove_menu_page( ‘edit.php’ ); //Posts //remove_menu_page( ‘upload.php’ ); //Media //remove_menu_page( ‘edit.php?post_type=page’ ); //Pages //remove_menu_page( ‘edit-comments.php’ ); //Comments //remove_menu_page( ‘themes.php’ ); //Appearance //remove_menu_page( ‘plugins.php’ ); //Plugins //remove_menu_page( ‘users.php’ ); //Users //remove_menu_page( ‘tools.php’ ); //Tools … Read more

Get author image from corresponding article in thumbnail

<?php echo get_avatar( get_the_author_meta( ‘ID’) , 150); ?> Is exactly what I use. I think the issue is with “foreach( $recent_posts as $recent )”, I recommend using if ( $wp_query->have_posts() ) : I recommend checking out https://developer.wordpress.org/reference/classes/wp_query/ and remember to reset the loop with after your done wp_reset_postdata();

Change author base and slug in author link

i found out what i was doing wrong, i used this part like i mentioned add_filter( ‘request’, ‘wpse5742_request’ ); function wpse5742_request( $query_vars ) { if ( array_key_exists( ‘author_name’, $query_vars ) ) { global $wpdb; $author_id = $wpdb->get_var( $wpdb->prepare( “SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key=’nickname’ AND meta_value = %s”, $query_vars[‘author_name’] ) ); if ( $author_id ) … Read more

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