New Landing How can we help? Atelier Remove author link on recent posts page builder element

Viewing 7 posts - 1 through 7 (of 7 total)
  • Posted in: Atelier
  • #254674
    pinponketo
    Member
    Post count: 36

    Hello SITeam,

    I want to remove the link to the author archive page on the “recent posts widget (of the swift page builder)”.

    Not buy hiding it through CSS because it is not a good SEO practice.

    BTW, I have enabled the option “Single Author Blog” on the theme options.

    You can see an example on the section “Latest News” on https://www.tequilaysoledad.com/

    Thanks in advance for your help

    Alonso

    #254710
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    It would be good if you replace the link with #.
    Thanks
    Mohammad

    #254796
    pinponketo
    Member
    Post count: 36

    But then it makes no sense from the user experience point of view. Ideally the line does not get printed. Can you assist me with it?

    #255131
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please paste this code at functions.php of child theme.

    
            function sf_get_recent_post_item( $post, $display_type = "bold", $excerpt_length = 20, $item_class = "" ) {
    
                $recent_post   = $recent_post_figure = $link_config = $item_icon = "";
                $thumb_type    = sf_get_post_meta( $post->ID, 'sf_thumbnail_type', true );
                $thumb_image   = rwmb_meta( 'sf_thumbnail_image', 'type=image&size=full' );
                $thumb_video   = sf_get_post_meta( $post->ID, 'sf_thumbnail_video_url', true );
                $thumb_gallery = rwmb_meta( 'sf_thumbnail_gallery', 'type=image&size=thumb-image' );
    
                foreach ( $thumb_image as $detail_image ) {
                    $thumb_img_url = $detail_image['url'];
                    break;
                }
    
                if ( ! $thumb_image ) {
                    $thumb_image   = get_post_thumbnail_id();
                    $thumb_img_url = wp_get_attachment_url( $thumb_image, 'full' );
                }
    
                // POST META
                global $sf_options;
                $single_author = $sf_options['single_author'];
                $remove_dates  = $sf_options['remove_dates'];
                $post_links_match_thumb = false;
                if ( isset( $sf_options['post_links_match_thumb'] ) ) {
                	$post_links_match_thumb = $sf_options['post_links_match_thumb'];	
                }
    
                $post_author    = get_the_author_link();
                $post_date      = get_the_date();
                $post_date_str  = get_the_date('Y-m-d');
                $item_title     = get_the_title();
                $post_permalink = get_permalink();
                $post_comments  = get_comments_number();
                $custom_excerpt = sf_get_post_meta( $post->ID, 'sf_custom_excerpt', true );
                $post_excerpt   = '';
                if ( $custom_excerpt != '' ) {
                    $post_excerpt = sf_custom_excerpt( $custom_excerpt, $excerpt_length );
                } else {
                    $post_excerpt = sf_excerpt( $excerpt_length );
                }
                $post_permalink_config = 'href="' . $post_permalink . '" class="link-to-post"';
                if ( $post_links_match_thumb ) {
                	$link_config = sf_post_item_link();
                	$post_permalink_config = $link_config['config'];
                }
    
                $thumb_width = apply_filters('sf_recent_post_item_thumb_width', 360);
                $thumb_height = apply_filters('sf_recent_post_item_thumb_height', 270);
    			
    			if ( $display_type == "standard-row" ) {
    				$thumb_width = apply_filters('sf_recent_post_item_thumb_width', 400);
    				$thumb_height = apply_filters('sf_recent_post_item_thumb_height', 300);
    			}
    			
                // MEDIA CONFIG
                $thumb_link_type          = sf_get_post_meta( $post->ID, 'sf_thumbnail_link_type', true );
                $thumb_link_url           = sf_get_post_meta( $post->ID, 'sf_thumbnail_link_url', true );
                $thumb_lightbox_thumb     = rwmb_meta( 'sf_thumbnail_image', 'type=image&size=large' );
                $thumb_lightbox_image     = rwmb_meta( 'sf_thumbnail_link_image', 'type=image&size=large' );
                $thumb_lightbox_video_url = sf_get_post_meta( $post->ID, 'sf_thumbnail_link_video_url', true );
                $thumb_lightbox_video_url = sf_get_embed_src( $thumb_lightbox_video_url );
                $thumb_lightbox_img_url   = wp_get_attachment_url( $thumb_lightbox_image, 'full' );
    
                // LINK CONFIG
                if ( $thumb_link_type == "link_to_url" ) {
                    $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"';
                    $item_icon   = apply_filters( 'sf_post_link_icon', "ss-link" );
                } else if ( $thumb_link_type == "link_to_url_nw" ) {
                    $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
                    $item_icon   = apply_filters( 'sf_post_link_icon', "ss-link" );
                } else if ( $thumb_link_type == "lightbox_thumb" ) {
                	$lightbox_id = rand();
                    if ( $thumb_img_url != "" ) {
                        $link_config = 'href="' . $thumb_img_url . '" class="lightbox" data-rel="ilightbox['.$lightbox_id.']"';
                    }
                    $item_icon   = apply_filters( 'sf_post_lightbox_icon', "ss-view" );
                } else if ( $thumb_link_type == "lightbox_image" ) {
                    $lightbox_image_url = '';
                    foreach ( $thumb_lightbox_image as $image ) {
                        $lightbox_image_url = $image['full_url'];
                    }
                    $lightbox_id = rand();
                    if ( $lightbox_image_url != "" ) {
                        $link_config = 'href="' . $lightbox_image_url . '" class="lightbox" data-rel="ilightbox['.$lightbox_id.']"';
                    }
                    $item_icon   = apply_filters( 'sf_post_lightbox_icon', "ss-view" );
                } else if ( $thumb_link_type == "lightbox_video" ) {
                    $link_config = 'data-video="' . $thumb_lightbox_video_url . '" href="#" class="fw-video-link"';
                    $item_icon   = apply_filters( 'sf_post_video_icon', "ss-video" );
                } else {
                    $link_config = 'href="' . $post_permalink . '" class="link-to-post"';
                    $item_icon   = apply_filters( 'sf_post_standard_icon', "ss-navigateright" );
                }
    
                if ( $thumb_type == "none" ) {
                    $recent_post .= '<div itemscope class="recent-post no-thumb ' . $item_class . ' clearfix">';
                } else {
                    $recent_post .= '<div itemscope class="recent-post has-thumb ' . $item_class . ' clearfix">';
                }
    
    			$recent_post_figure .= '<div class="figure-wrap">';
    
                $recent_post_figure .= apply_filters( 'sf_before_recent_post_thumb' , '');
    
                $recent_post_figure .= '<figure class="animated-overlay overlay-alt">';
    
                if ( $thumb_type == "video" ) {
    
                    $video = sf_video_embed( $thumb_video, 400, 225 );
                    $recent_post_figure .= '<div class="video-thumb">' . $video . '</div>';
    
                } else if ( $thumb_type == "slider" ) {
    
                    $recent_post_figure .= '<div class="flexslider thumb-slider"><ul class="slides">';
    
                    foreach ( $thumb_gallery as $image ) {
                        $alt = $image['alt'];
                        if ( ! $alt ) {
                            $alt = $image['title'];
                        }
                        $recent_post_figure .= "<li><a " . $link_config . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$alt}' /></a></li>";
                    }
    
                    $recent_post_figure .= '</ul></div>';
    
                } else {
    
                    if ( $thumb_img_url == "" && $thumb_type != "none" ) {
                        $thumb_img_url = "default";
                    }
    
                    $image = sf_aq_resize( $thumb_img_url, $thumb_width, $thumb_height, true, false );
    
                    if ( $image ) {
                        $recent_post_figure .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                        $recent_post_figure .= '<a ' . $link_config . '></a>';
                        $recent_post_figure .= '<div class="figcaption-wrap"></div>';
                        
                        if ( $display_type == "showcase" ) {
                        	$recent_post_figure .= '<figcaption><div class="thumb-info">';
                    	    $recent_post_figure .= '<h5><span class="post-date updated">' . $post_date . '</span></h5>';
                    	    $recent_post_figure .= '<h4>' . $item_title . '</h4>';
                    	    $recent_post_figure .= '</div></figcaption>';
                        } else {
    		                $recent_post_figure .= '<figcaption><div class="thumb-info thumb-info-alt">';
    		                $recent_post_figure .= '<i class="' . $item_icon . '"></i>';
    		                $recent_post_figure .= '</div></figcaption>';
                    	}
                    }
                }
    
                $recent_post_figure .= '</figure>';
    
                $recent_post_figure .= '</div>';
    
                if ( $display_type == "bold" ) {
    
                    $recent_post .= $recent_post_figure;
                    $recent_post .= '<div class="details-wrap">';
                    if ( $thumb_type == "none" ) {
                        $recent_post .= '<h2><a ' . $post_permalink_config . '>' . $item_title . '</a></h2>';
                    } else {
                        $recent_post .= '<h3><a ' . $post_permalink_config . '>' . $item_title . '</a></h3>';
                    }
                    $recent_post .= sf_get_post_details($post->ID, true);
                    $recent_post .= '</div>';
    
                } else if ( $display_type == "list" ) {
    
                   // $recent_post .= '<a class="list-post-link" href="' . $post_permalink . '"></a>';
                    if ( $image ) {
                        $recent_post_figure .= '<figure class="animated-overlay">';
                        $recent_post_figure .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                        $recent_post_figure .= '<a ' . $link_config . '></a>';
                        $recent_post_figure .= '<div class="figcaption-wrap"></div>';
                        $recent_post_figure .= '<figcaption><div class="thumb-info thumb-info-alt">';
                        $recent_post_figure .= '<i class="' . $item_icon . '"></i>';
                        $recent_post_figure .= '</div></figcaption>';
                        $recent_post_figure .= '</figure>';
                    }
                    $recent_post .= '<div class="details-wrap">';
                    $recent_post .= '<h4>' . $item_title . '</h4>';
                    $recent_post .= '<div class="post-item-details">';
                    $recent_post .= '<span class="post-date updated">' . $post_date . '</span>';
                    $recent_post .= '</div>';
                    $recent_post .= '</div>';
    
                } else if ( $display_type == "bright" ) {
    
                    $recent_post .= '<div class="details-wrap">';
                    $recent_post .= '<div class="author-avatar">' . get_avatar( get_the_author_meta( 'ID' ), '140' ) . '</div>';
                    $recent_post .= '<h6 class="post-item-author"><span class="author">' . sprintf( '<a href="%2$s" rel="author" itemprop="author">%1$s</a>', $post_author, get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '</span></h6>';
                    $recent_post .= '<h2><a ' . $post_permalink_config . '>' . $item_title . '</a></h2>';
                    $recent_post .= '<div class="post-item-details">';
                    $recent_post .= '<span class="post-date updated">' . $post_date . '</span>';
                    $recent_post .= '</div>';
                    $recent_post .= '</div>';
    
    			} else if ( $display_type == "bold" ) {
    
                    $recent_post .= $recent_post_figure;
                    $recent_post .= '<div class="details-wrap">';
                    if ( $thumb_type == "none" ) {
                        $recent_post .= '<h2><a ' . $post_permalink_config . '>' . $item_title . '</a></h2>';
                    } else {
                        $recent_post .= '<h3><a ' . $post_permalink_config . '>' . $item_title . '</a></h3>';
                    }
                    $recent_post = sf_get_post_details($post->ID, true);
                    $recent_post .= '</div>';
    			
    			} else if ( $display_type == "showcase" ) {
    			
                    $recent_post .= $recent_post_figure;
                                
                } else {
    
                    $recent_post .= $recent_post_figure;
                    $recent_post .= '<div class="details-wrap">';
                    $recent_post .= '<h5><a ' . $post_permalink_config . '>' . $item_title . '</a></h5>';
                    $recent_post .= sf_get_post_details($post->ID, true);
                    if ( $excerpt_length != "0" && $excerpt_length != "" ) {
                        $recent_post .= '<div class="excerpt">' . $post_excerpt . '</div>';
                    }
    
                    if ( sf_theme_opts_name() == "sf_atelier_options" && $display_type == "standard-row" ) {
                    	$recent_post .= '<a class="read-more-button" href="' . get_permalink() . '">' . __( "Read more", "swiftframework" ) . '</a>';
                    }
    
                    $recent_post .= '</div>';
    
                }
    
                $recent_post .= '</div>';
    
                return $recent_post;
            }
        

    Thanks
    Mohammad

    #255132
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Can you provide a screenshot so I can know exactly what it is so I can check a solution for you?
    Thanks

    -Rui

    #286702
    GemmaIGCC
    Member
    Post count: 9

    Hi there,

    Is there a simpler way to stop the author link line showing up on the recent posts? I just want that line gone all together.
    http://igcc.wpengine.com/?page_id=19

    Thanks,
    Jess

    #286708
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please use this custom css code:-

    .recent-post .author{
    display:none !important;
    }

    Thanks
    Mohammad

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register