• Resolved Ron

    (@donniepeters)


    I have noticed that in a list of posts and on the actual posts themselves that in he Byline area it only displays the Author pic if one is logged into the website as a registered user. All of our Author accounts are all Guest Authors with no access to our website.

    For the public the listing of posts uses a Gravatar icon where the Author pic would be if logged in.

    Looking at the code for the Author Pic for “Baker Park” for all non-logged in users (ie public) it shows:

    <a class="molongui-disabled-link"><img src="https://secure.gravatar.com/avatar/?s=96&amp;d=mm&amp;r=g" width="32" height="32" class="author" alt="Baker Park">Baker Park</a>

    Where as for a logged in user where the Author Pic is no displayed it shows:

    <a class="molongui-disabled-link"><img src="https://my-webiste.blah/wp-content/uploads/baker-park.jpg" width="32" height="32" class="author" alt="Baker Park">Baker Park</a>

    Why is the Author Pic in the byline area not displaying to the public who visit our website but does display to logged in Admins??

    Please note that this is not affecting the “Author Box” at the bottom of posts which works at all times and we appreciate that.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Molongui

    (@molongui)

    Hi @donniepeters,

    Thanks for reaching out! Just for testing purposes, could you please assign a post to a registered WP user whose account has an avatar (either from Gravatar or an uploaded picture) and check whether the picture is displayed in your frontend when you are not logged in?

    If you do get to see the image, please deactivate our plugin and check again. Is the image displayed?

    I’ve inspected your theme’s source code and they are doing something I don’t quite understand. Maybe that’s where the issue is coming from. If that’s the case, we could open a support ticket with them regarding this.

    Please let us know so we can assist you further.

    Thread Starter Ron

    (@donniepeters)

    Thanks for getting back to me. I created a Test Post under a registered users name. It too displays the Gravatar icon for public facing view but the name us linked to the Author page which under your plugin is a premium feature we do not yet have.

    Oddly the Author pic displaying for that user is showing our Admin users icon (ie our logo) in the Byline and not their own Pic as selected which does show properly in the Author Box.

    We had converted registered users to have a second Author profile as originally their Name and the Author link showed for the few posts they did and not for ones done by Guests Authors. We did this for uniformity.

    Thread Starter Ron

    (@donniepeters)

    Updated:

    Oddly the Author pic displaying for that user is showing our Admin users icon (ie our logo) in the Byline and not their own Pic as selected which does show properly in the Author Box.

    So I logged in as another Admin User and the posts that the Author has been changed to a Registered User are showing the Author Pic of the Logged in User in the Byline and not the pic attached to the Registered User assigned to the post. We have 3 Registered Admin accounts and the same Test Post will display 3 different pics depending on who is logged in and no pic but a link to their Author Page is displayed to non-logged in users (Public)

    Thread Starter Ron

    (@donniepeters)

    If you do get to see the image, please deactivate our plugin and check again. Is the image displayed?

    When the Mologui plugin is deactivated – posts with a Registered User which has a Gravatar Pic do NOT show the assigned Gravatar pic to the public but will show the Gravatar pic of that logged in user on the post.

    I get this is not making sense but it is what is happening

    Plugin Author Molongui

    (@molongui)

    Thanks for carrying out all those checks, Ron. That’s what I suspected after inspecting your theme’s source code. It turns out the issue is not related to our plugin, but rather to your theme.

    You should open a support ticket with them, informing them of this issue and indicating that it originates from line 389 in the newsmash/inc/extras.php file.

    $user = wp_get_current_user(); ?>
    <li class="list-inline-item"><a href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) ));?>"><img src="<?php echo esc_url( get_avatar_url( $user->ID ) ); ?>" width="32" height="32" class="author" alt="<?php esc_attr(the_author()); ?>"/><?php esc_html(the_author()); ?></a></li>

    They are retrieving the avatar’s URL for the current logged-in user instead of the post’s author, which, in my opinion, makes no sense.

    I’m closing this ticket now, but if anything comes up, feel free to re-open it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Author Pic displays only to logged in users’ is closed to new replies.