author link Live Stream Widget not working

Just noticed that the link for the author of the comment does not work. It takes you to a page that says ;

--------------------------------------
Nothing Found

Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.
--------------------------------------

see attached image; clicked on author "Homeowner" and got "Nothing Found" page.

  • Vinod Dalvi

    Hi @thevillageblog,

    I hope you are well today and thanks for posting on the forum.

    I have tested it on my test site using latest version of Live Stream Widget plugin and found the author links are working fine without any issue with default WordPress theme Twenty Twelve.

    I have tested it on your site and confirmed the issue but the author links are working foe some authors there like "Marty", "cwwilson" etc. as shown in the attached screenshot.

    Make sure that the authors having the issue exist and are active on your site.

    This can be due to plugin/theme conflict on your site.

    You can just try on your development site temporary using default WordPress theme like Twenty Fifteen and temporary deactivating all other plugins as displayed in the following flowchart to know which theme/plugin is conflicting if any.

    https://premium.wpmudev.org/manuals/getting-support/

    Would you mind if I logged in to your site and did some troubleshooting? This might help get to the bottom of this faster. If this is ok, just grant me temporary admin access to your site by clicking "Grant Access" button in the WPMU DEV Dashboard Settings as described on the following page and reply on this thread after granting it?

    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Kind Regards,
    Vinod Dalvi

  • thevillageblog

    I have granted access to our test site http://vatpt1.thevillageblog.com/villageatthepark which has the same plugin only content is different. This site has actual members and they are all live so please avoid any messaging as they would be received by the members.
    Look for the user ahein who is a test member that we constantly use and his link does not work.
    One thing I noticed is that if the author does not have any blog posts there is an error. cwwilson and Jackie have blog posts, the others only made comments. If this is correct then the widget should send the user to the author's buddypress profile or not be an active link.
    Your thoughts?

  • Vinod Dalvi

    Hi @thevillageblog,

    Thank you for describing the issue.

    I could confirm the issue on my test site using latest version of Live Stream Widget plugin that the users who have only commented on the articles but didn't write any article linked to the page not found page in the Live Stream Widget.

    I have notified this to the plugin developer so that it will be fixed.

    The issue will be fixed shortly.

    In the meanwhile to remove the links displayed in the Live Stream Widget of such users you can edit the following Live Stream Widget plugin file on line number 1351 as displayed below.

    Live Stream Widget plugin file :
    /wp-content/plugins/live-stream-widget/live-stream.php

    Before Editing :

    /* Build an anchor wrapper for the author which is used in multiple places */
    if ((isset($blog->siteurl)) && (intval($item->post_author_id) )) {
    	$author_anchor_begin 	= '<a '. $link_target .' class="live-stream-item-author" href="'. $blog->siteurl .'?author='
    		. $item->post_author_id .'">';

    After Editing :

    /* Build an anchor wrapper for the author which is used in multiple places */
    if ((isset($blog->siteurl)) && (intval($item->post_author_id) )) {
    $blog_siteurl = count_user_posts( $item->post_author_id ) ? $blog->siteurl.'?author='. $item->post_author_id : '#';
    $author_anchor_begin 	= '<a '. $link_target .' class="live-stream-item-author" href="'. $blog_siteurl .'">';

    Best Regards,
    Vinod Dalvi

  • Ash

    Hello @thevillageblog

    In that case, please try to replace

    /* Build an anchor wrapper for the author which is used in multiple places */
    		if ((isset($blog->siteurl)) && (intval($item->post_author_id) )) {
    			$author_anchor_begin 	= '<a '. $link_target .' class="live-stream-item-author" href="'. $blog->siteurl .'?author='
    				. $item->post_author_id .'">';
    			$author_anchor_end 		= '</a>';
    
    		} else {
    			if ($item->post_type == "comment") {
    				$author_anchor_begin 	= '<a '. $link_target .' class="live-stream-item-author" href="'. $item->post_permalink .'#comment-'. $item->comment_id .'">';
    				$author_anchor_end 		= '</a>';
    			} else {
    				$author_anchor_begin 	= '';
    				$author_anchor_end 		= '';
    			}
    		}

    with

    /* Build an anchor wrapper for the author which is used in multiple places */
    if ((isset($blog->siteurl)) && (intval($item->post_author_id) )) {
    	$blog_siteurl = count_user_posts( $item->post_author_id ) ? $blog->siteurl.'?author='. $item->post_author_id : '#';
    	if( $blog_siteurl == '#' ){
    		$author_anchor_begin 	= '<a '. $link_target .' class="live-stream-item-author" href="'. $blog_siteurl .'">';
    		$author_anchor_end 		= '</a>';
    	}else{
    		$author_anchor_begin 	= '';
    		$author_anchor_end 		= '';
    	}
    
    } else {
    	if ($item->post_type == "comment") {
    		$author_anchor_begin 	= '<a '. $link_target .' class="live-stream-item-author" href="'. $item->post_permalink .'#comment-'. $item->comment_id .'">';
    		$author_anchor_end 		= '</a>';
    	} else {
    		$author_anchor_begin 	= '';
    		$author_anchor_end 		= '';
    	}
    }

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

    Cheers
    Ash

  • thevillageblog

    Dear Ash,
    I replaced the code as you instructed but it seems to have the opposite effect of what I was trying to do. Instead of the member who is not the blog post author, it deactivated the blog post author, so now none of the author links work as expected. You can see the result on the test site http://vatpt1.thevillageblog.com/villageatthepark to which you have been granted access.
    Thanks,
    Lucien

  • Vinod Dalvi

    Hi Lucien,

    To remove the author link you can try replacing my previously provided code with the following code.

    /* Build an anchor wrapper for the author which is used in multiple places */
    if ((isset($blog->siteurl)) && (intval($item->post_author_id) )) {
    $blog_siteurl = count_user_posts( $item->post_author_id ) ? $blog->siteurl.'?author='. $item->post_author_id : '#';
    if ( $blog_siteurl == '#' ) {
    	$author_anchor_begin 	= '<span class="only-commenter">';
    	$author_anchor_end 		= '</span>';
    } else {
    	$author_anchor_begin 	= '<a '. $link_target .' class="live-stream-item-author" href="'. $blog_siteurl .'">';
    	$author_anchor_end 		= '</a>';
    }

    Also the code line number is for me 1351 as shown in the attached screenshot and i am using standard sub lime 2 text editor but add the code in appropriate place which occurs in your editor which is 2701.

    Best Regards,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.