Post list based on the page author

As mentioned by @mridul-aggarwal WordPress supports author pages with the author.php template (Author_Template). If you are setting up a custom template you will need some method of letting the template discover which user is supposed to be displayed, this is usually done via a POST/GET request or in the URI http://example.com/path/to/user/username which you can then … Read more

Showing author page if user has no post

<?php $curauth = (isset($_GET[‘author_name’])) ? get_user_by(‘slug’, $author_name) : get_userdata(intval($author)); ?> <?php if ( have_posts() ) ?> <h2>Posts by <?php echo $curauth->nickname; ?>:</h2> <ul> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <li> <a href=”https://wordpress.stackexchange.com/questions/106902/<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”> <?php the_title(); ?></a>, <?php the_time(‘d M Y’); ?> … Read more

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