Adding in Author Name to Widget on Status Plugin

Just wanting to add a few things.

1. I’d like to add the author name next to the avatar within the widget, similar to Twitter.

E.g

Avatar Author Name

Post Title

Post Content

2. The avatar links to my author pages aren’t working.

Code should be;

first_name . ‘-‘ . $current_user->last_name; ?>”>’

3. I tried this code to remove the media library section, but didn’t work when adding it to my theme css.

li#tab-library{

display: none !important;

}

Hope you can help. I’ve granted access in the support access section.

Robin .

  • aristath
    • Recruit

    Hello there @robin, I hope you’re well today!

    I can’t say I fully understood what you want to do… Can you post a link to the page in question so that I may see this in action?

    I tried accessing your site but the access token is invalid, can you please revoke and re-grant us access?

    Cheers,

    Ari.

  • Robin
    • Flash Drive

    Hey Ari

    In the widget,

    it’s displaying

    Avatar Post Title

    Post Content

    I’d like to add in Author Name ( similar to twitter )

    Avatar Author Name ( and author url link)

    Post Title

    Post Content

    I’ve re-granted access :slight_smile:

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hi Robin,

    1. I’m rewriting that part of the plugin for you, it’s taking some time.

    2. Avatars appear in several places, which case (i.e. author boxes, in post meta info, in BuddyPress, in comments, etc.) do you need avatars to link to author pages and not user profiles? (Am I understanding that issue correctly?)

    3. That code needs to go in a custom CSS file, not your theme’s CSS. The status plugin has it’s own CSS file, which you don’t want to overwrite, so you’ll need to add custom CSS which can override any theme or plugin’s built in CSS. If you have Jetpack, it comes with a Custom CSS tool, some themes have a setting where you can add custom CSS, or you can download a plugin, like this one: https://wordpress.org/plugins/simple-custom-css/, where you can paste any custom CSS you have.

  • Robin
    • Flash Drive

    Hey Michelle,

    Thank you so much for your patience and support. It’s greatly appreciated.

    I’m mainly concerned with the 2nd issue.

    My avatars don’t seem to link to a user profile or author page.

    I’ve found the code to edit;

    $avatar = get_avatar($post->post_author, $size, null, $name);
    if ($this->_link_avatars) {
    $url = apply_filters('the_author', $user->display_name);
    if ($this->_external_avatars_link && !empty($user->user_url)) {
    $url = $user->user_url;

    And I need to add in this code to that;

    echo site_url('/user/') . $current_user->first_name . '-' . $current_user->last_name;

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hi Robin,

    I’m not sure that code is what you’re looking for, can you give me a few more details?

    In which file did you find that avatar code?

    This is typically the code I’ve used to make author avatars clickable, and linked to a proper page :

    <?php get_author_posts_url( $author_id, $author_nicename ); ?>

    But again, there are a lot of places where avatars show up, so this code will usually need to be added across multiple files, and it will need some altering to reflect member avatars as well as authors. (Members who aren’t authors won’t have an author page to go to, so they’d need to go to their user profile.) Do you want this functionality on just author avatars that appear next to blog posts?

    Would you mind sharing the name of your theme? If I’m familiar with it or can get my hands on it, I can help sort through all the template files to find all the avatar instances.

    Thanks!

  • Robin
    • Flash Drive

    Hey Michelle,

    No need to worry. I've fixed all the issues :slight_smile:

    Only 1 bug to work on, which is the clashing of the TB prefix. ( Thickbox)

    – I thought it was the stylesheet, but it's the loading of the content which is a problem.

    If you take a look at the screenshot. You can see that after 2 images in the lightbox it just displays a loading image.

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hi Robin,

    I’m so glad you got all the other issues sorted so quickly! Would you mind marking your other threads on these topics resolved? Great, thanks!

    Which plugins do you believe are conflicting and causing the Lightbox issues? I know you brought this up in another thread, but I’ve probably seen 100 threads since that one.

    Thanks!

  • Robin
    • Flash Drive

    No worries. Shall do that right away!

    I think it's between Gravityview and Status plugin.

    I run my directory on gravityview, so I can't exactly "deactivate" it.

    The gravityview has an option to display uploaded images to be viewed in "lightbox", but even when unticking this option the lightbox still loads.

    After installing the status plugin, it seems to have caused a conflict.

    I think it's the fact that it wants to load up the "wp thickbox" ( See screenshot)

    Also I've installed the custom css, and added the hide library tab, but it still shows.

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hey there, Robin!

    I took a guess, and commented out the ThickBox fix in the Status plugin’s CSS file. There’s a chance ThickBox fixed itself after that fix was added, so it could be the root of the conflict. Give it a try now, and if we’re still not getting anywhere, I have a few more tricks up my sleeve.

    Even with !important, it looks like no custom CSS will override Status’ CSS. I’ve tried removing the bar altogether, I’m conferring with my teammate Tyler to see if we can find the magic bit of CSS to make it go away.

    Let me know how the ThickBox is behaving now. Thanks!

  • Robin
    • Flash Drive

    Hey Michelle and Tyler,

    That didn’t seem to work. I don’t think the issue is the css, but more the javascript itself. I think if you can re-name the class or div, that might work?

    Thank you for having a go at it ! Really appreciate it !

    I’m sure we will find out a way – there is always a way hehe. Also if you want the code for the avatar url link, I’ve custom fixed it, so just ask if you want me to send it across.

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hey Robin!

    It looks like the support access token expired, would you mind re-upping it? Thanks!

    I’m getting a little further, I managed to hide the entire tab bar, but it also hid it in the media library, where you’re going to need it, on the back end.

    Apparently Thickbox is kind of a bear to override, so this is definitely a bigger challenge than it looks like from the outside. We’ll get it all fixed up, I’m taking it as a challenge now. *glares at thickbox CSS*

    Let me know when access is re-granted. : )

  • Michelle Shull
    • DEV MAN’s Apprentice

    Heya, Robin!

    I just talked to my friend and colleague @ashok, who is a whiz at just about everything WordPress related. He’s halfway around the world from me, and off for the evening, but he’s going to take a look at this first thing tomorrow. I’m at the bottom of my bag of tricks.

    If it can be fixed, Ashok can fix it.

  • Ash
    • WordPress Hacker

    Hello @robin

    Please try the following code:

    function remove_media_library_tab($tabs) {
    unset($tabs['library']);
    return $tabs;
    }
    add_filter('media_upload_tabs', 'remove_media_library_tab');

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name ‘mu-plugins’. If there is no folder in that name, then create a folder, name it ‘mu-plugins’, create a file inside that, give any name you like and paste the code in there. You don’t need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Cheers

    Ash

  • Robin
    • Flash Drive

    Hey Ashok,

    That worked perfectly !

    I've only got 1 more problem, that I hope you can help with.

    When I try and click on an image gallery which requires opening in a thickbox there seems to be a huge conflict and only displays 2 images then has a java error ( please see screenshot).

  • Robin
    • Flash Drive

    It’s between the Status plugin and the gravityview plugin, but they both seem to use the thickbox ( from the wordpress default). The gravityview works fine without status.

    But seem to just overlap when it comes to using the TB.

    It’s a directory, so has this affect on all 500 entries.

    Robin

  • Robin
    • Flash Drive

    Hey Michelle,

    Lovely to hear from you. Sorry for the delay, I was just in London.

    I’ve enabled the lightbox with the Status plugin disabled. It was a shortcode on the page.

    So you should be able to view it :slight_smile:

    It works without the status plugin…but obviously I’d love for it to work with it xD

  • Ash
    • WordPress Hacker

    Hello @robin

    Please check now. There might be still some conflicts I believe but if you can confirm then please send your ftp to me.

    As the other plugin is a huge and I have no idea, so I can’t confirm you but I will try my best.

    Also send some screenshots of you see it wrong.

    To send me details, please use our contact form: https://premium.wpmudev.org/contact/

    Select: I have a different question

    Subject: Attn-Ash

    Details: Send all required details (admin info and/or ftp details) with a link of this thread, so that I can track.

    Also post a note here once you send the info.

    I will be happy to take a look :slight_smile:

    Cheers

    Ash

  • Ash
    • WordPress Hacker

    Just FYI, used code so far:

    <script type="text/javascript">
    jQuery(function($) {
    setInterval(function() {
    $('ul.gv-field-file-uploads li a').each(function() {
    $(this).attr('href', $(this).find('img').attr('src'));
    });
    }, 500);
    });
    </script>
    <style>
    #TB_window{padding: 0 20px 30px 0 !important; width: auto !important}
    </style>

    Cheers

    Ash

  • Ash
    • WordPress Hacker

    Hello @robin

    I have tried a lot but it seems it needs lots of changes in the status plugin. And That may break other things of status plugin, so it is risky.

    I can try to force to reposition the lightbox with hard code css. Let me know if you are open to do this.

    Cheers

    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.