Changes show up in view source but not live site

You are echoing the author link generator inside an already opened anchor tag, which is causing error. Try this code: Method 1 <?php if ( !is_page() ) : $author_posts_url = the_author_link(); $posts_by_title = sprintf( __( ‘Posts by %1$s ( @%2$s )’, ‘p2-breathe’ ), get_the_author_meta( ‘display_name’ ), get_the_author_meta( ‘user_nicename’ ) ); ?> <a href=”https://wordpress.stackexchange.com/questions/251479/<?php echo esc_url( … Read more

How do I create WordPress Authors Dropdown with links

I could be wrong as I don’t know how WordPress controls the dropdown menu but looks like it could be only returning a name of the author and not a link to their page. I have tested the below code in a WordPress site environment and works including linking to the authors page. <select name=”author-dropdown” … Read more

Add Date and Author to Posts

Use the following code in file template single.php (https://developer.wordpress.org/reference/functions/get_day_link/#user-contributed-notes ) : <?php $archive_year = get_the_time( ‘Y’ ); $archive_month = get_the_time( ‘m’ ); $archive_day = get_the_time( ‘d’ ); $month= get_the_date(‘M’); ?> <div class=”custom_archives”> <p> Posted on: <a href=”https://wordpress.stackexchange.com/questions/310792/<?php echo esc_url( get_day_link( $archive_year, $archive_month, $archive_day ) ); ?>”><?php echo $month. ” “.$archive_day.”, ” .$archive_year; ?> </a> </p> … Read more

Author name is not working on category page

You need to pass in the author ID properly. This line: <?php echo get_the_author_meta(‘display_name’, $author_id); ?> Should be this: <?php echo get_the_author_meta( ‘display_name’, $mypost->post_author ); ?> Alternatively you could use setup_postdata() in your foreach loop to setup the global $post variable and make use of the template tag functions without having to pass in the … Read more

Difference between last_name and user_lastname

Short answer to “Which property am I supposed to use“: Use first_name and last_name. Longer answer: The properties first_name, user_firstname, last_name and user_lastname are defined in the WP_User class, and despite the different names (i.e. one with user_ and the other without that prefix): Both first_name and user_firstname use the value of the first_name meta. … Read more

I have two problems ( SEO )

The problem is that your author pages are marked with the noindex tag, look at the page source: It must be a plugin that is doing that, that is not the default setting. If you don’t want the duplicate pages, try a plugin like Yoast WordPress SEO that let you add Nofollow to comment links.

Clean links in: the_author_meta(‘description’)

<?php // grab description, // note the “get_”, we’re not echoing the author meta, we’re returning it $user_description = get_the_author_meta(‘description’); // removing all HTML tags: echo strip_tags($user_description); // removing all tags apart from paragraphs: echo strip_tags($user_description,'<p>’); // removing just anchors (i.e. <a> tags): echo preg_replace(array(‘{<a[^>]*>}’,'{</a>}’),array(”,”),$user_description); // removing all links including their text (i.e. <a href=”https://wordpress.stackexchange.com/questions/33568/…”>…</a>): … Read more

Most recent post is missing from Author page

The mistake is in your first block of code: <?php if (have_posts()): the_post(); ?> <h3> <?php _e(‘All posts by’); ?> <?php echo get_the_author(); ?> <span class=”arrows”>&raquo;</span> </h3> <?php while (have_posts()) : the_post();?> You call the_post() to populate the regular template tags (i.e. get_the_author()) but don’t use the rest of the post. Then, inside your while … Read more

Allow Google crawler to crawl specific Author pages

I would normally ask a couple clarifying questions but I don’t have the reputation to do it so let’s see if I can give you a workable solution. I don’t know what you consider to be high quality but if it is certain fields being complete, you could do an if/else statement around those fields … Read more