New Landing How can we help? Themeforest Theme Support Flexform Alter blog-item-details

Viewing 5 posts - 1 through 5 (of 5 total)
  • Posted in: Flexform
  • #258590
    frstrat
    Member
    Post count: 3

    I want to alter blog-item-details to only show the date.

    I’ve already added the css to hide the anchor element in blog-item-details but this now shows the details as such:

    By on March 23, 2016

    I need to “By on” gone as well. Date only.

    Thanks so much.

    #258635
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    You would have to edit the php files to remove that text as it’s not in it’s own tag that you can remove wth css. Is this for recent posts or blog?

    – Kyle

    #258636
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

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

    function sf_get_post_item($postID, $blog_type, $show_title = "yes", $show_excerpt = "yes", $show_details = "yes", $excerpt_length = "20", $content_output = "excerpt", $show_read_more = "yes") {
    		
    			$post_item = "";
    			
    			$post_format = get_post_format($postID);
    						
    			global $post, $sidebars;
    			$post_format = get_post_format();
    			if ( $post_format == "" ) {
    				$post_format = 'standard';
    			}
    			$post_title = get_the_title();
    			$post_author = get_the_author_link();
    			$post_author_id = $post->post_author;
    			$post_date = get_the_date();
    			$post_categories = get_the_category_list(', ');
    			$post_comments = get_comments_number();
    			$post_permalink = get_permalink();
    			$custom_excerpt = get_post_meta($postID, 'sf_custom_excerpt', true);
    			$post_excerpt = '';
    			if ($content_output == "full_content") {
    				$post_excerpt = get_the_content_with_formatting();			
    			} else {
    				if ($custom_excerpt != '') {
    					$post_excerpt = custom_excerpt($custom_excerpt, $excerpt_length);
    				} else {
    					if ($post_format == "quote") {
    					$post_excerpt = get_the_content_with_formatting();
    					} else {
    					$post_excerpt = excerpt($excerpt_length);
    					}
    				}
    			}
    			if ($post_format == "chat") {
    			$post_excerpt = sf_chat_post($postID);
    			}
    			
    			$post_item = $thumb_image = $thumb_width = $thumb_height = $bordered_thumb_width = $bordered_thumb_height = $video = $video_height = $bordered_video_height = $item_class = $link_config = $item_icon = '';
    				
    			if ($blog_type == "mini") {
    				if ($sidebars == "no-sidebars") {
    				$thumb_width = 446;
    				$thumb_height = NULL;
    				$video_height = 335;
    				} else {
    				$thumb_width = 290;
    				$thumb_height = NULL;
    				$video_height = 218;
    				}
    			} else if ($blog_type == "masonry") {
    				if ($sidebars == "both-sidebars") {
    				$item_class = "span3";
    				} else {
    				$item_class = "span4";
    				}
    				$thumb_width = 480;
    				$thumb_height = NULL;
    				$video_height = 360;
    			} else {
    				if ($sidebars == "both-sidebars") {
    					if ($show_details == "yes") {
    						$standard_post_width = "span5";
    					} else {
    						$standard_post_width = "span6";
    					}
    				} else if ($sidebars == "right-sidebar" || $sidebars == "left-sidebar" || $sidebars == "one-sidebar") {
    					if ($show_details == "yes") {
    						$standard_post_width = "span6";
    					} else {
    						$standard_post_width = "span7";
    					}
    				} else {
    					if ($show_details == "yes") {
    						$standard_post_width = "span10";
    					} else {
    						$standard_post_width = "span11";
    					}
    				}
    				$thumb_width = 970;
    				$thumb_height = NULL;
    				$video_height = 728;
    			}
    			
    			
    			$thumb_type = get_post_meta($postID, 'sf_thumbnail_type', true);
    			$thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
    			$thumb_video = get_post_meta($postID, 'sf_thumbnail_video_url', true);
    			$thumb_gallery = rwmb_meta( 'sf_thumbnail_gallery', 'type=image&size=blog-image' );
    			$thumb_link_type = get_post_meta($postID, 'sf_thumbnail_link_type', true);
    			$thumb_link_url = get_post_meta($postID, '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 = get_post_meta($postID, 'sf_thumbnail_link_video_url', true);
    			
    			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' );
    			}
    			
    			$thumb_lightbox_img_url = wp_get_attachment_url( $thumb_lightbox_image, 'full' );
    			
    			$item_figure = $link_config = "";
    			
    			// LINK TYPE VARIABLES			
    			if ($thumb_link_type == "link_to_url") {
    				$link_config = 'href="'.$thumb_link_url.'" class="link-to-url"';
    				$item_icon = "link";
    			} else if ($thumb_link_type == "link_to_url_nw") {
    				$link_config = 'href="'.$thumb_link_url.'" class="link-to-url" target="_blank"';
    				$item_icon = "link";
    			} else if ($thumb_link_type == "lightbox_thumb") {
    				$link_config = 'href="'.$thumb_img_url.'" class="view"';
    				$item_icon = "search";
    			} else if ($thumb_link_type == "lightbox_image") {
    				$lightbox_image_url = '';
    				foreach ($thumb_lightbox_image as $image) {
    					$lightbox_image_url = $image['full_url'];
    				}
    				$link_config = 'href="'.$lightbox_image_url.'" class="view"';
    				$item_icon = "search";	
    			} else if ($thumb_link_type == "lightbox_video") {
    				$link_config = 'href="'.$thumb_lightbox_video_url.'" rel="prettyphoto"';
    				$item_icon = "facetime-video";
    			} else {
    				$link_config = 'href="'.$post_permalink.'" class="link-to-post"';
    				$item_icon = "file-alt";
    			}	
    			
    			// THUMBNAIL MEDIA TYPE SETUP
    			
    			if ($thumb_type != "none") {
    			
    			$item_figure .= '<figure>';
    							
    			if ($thumb_type == "video") {
    				
    				$video = video_embed($thumb_video, $thumb_width, $video_height);
    				
    				$item_figure .= $video;
    				
    			} else if ($thumb_type == "slider") {
    				
    				$item_figure .= '<div class="flexslider thumb-slider"><ul class="slides">';
    							
    				foreach ( $thumb_gallery as $image )
    				{
    				    $item_figure .= "<li><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></li>";
    				}
    																
    				$item_figure .= '</ul><div class="open-item"><a '.$link_config.'></a></div></div>';
    				
    			} else {
    				
    				if ($thumb_img_url == "") {
    					$thumb_image = get_post_thumbnail_id($postID);
    					$thumb_img_url = wp_get_attachment_url( $thumb_image, 'full' );
    				}
    				
    				$image = aq_resize( $thumb_img_url, $thumb_width, $thumb_height, true, false);
    				
    				if ($image) {
    					
    					$item_figure .= '<a '.$link_config.'>';
    					
    					if ($blog_type != "standard") {
    					$item_figure .= '<div class="overlay"><div class="thumb-info">';
    					$item_figure .= '<i class="icon-'.$item_icon.'"></i>';
    					$item_figure .= '</div></div>';
    					}
    								
    					$item_figure .= '<img src="'.$image[0].'" width="'.$image[1].'" height="'.$image[2].'" />';
    								
    					$item_figure .= '</a>';
    				}
    			}
    			
    			$item_figure .= '</figure>';
    			
    			}
    				
    			// MASONRY STYLING				
    			if ($blog_type == "masonry") {
    				
    				if ($post_format == "quote") {
    					$post_item .= '<div class="quote-display"><i class="icon-quote-left"></i></div>';
    				} else {
    					$post_item .= $item_figure;
    				}
    				
    				$post_item .= '<div class="details-wrap">';
    				
    				if ($show_title == "yes") {
    					if ($post_format == "link") {
    					$post_item .= '<h4>'.sf_link_post($postID).'</h4>'; 	
    					} else {
    					$post_item .= '<h4><a href="'.$post_permalink.'">'.$post_title.'</a></h4>'; 				
    					}
    				}
    				
    				// POST EXCERPT
    				if ($post_excerpt != "0" && $show_excerpt == "yes") {
    					$post_item .= '<div class="excerpt">'. $post_excerpt .'</div>';
    				}
    				
    				if ($show_read_more == "yes") {
    				$post_item .= '<a class="read-more" href="'.$post_permalink.'">'.__("Read more", "swiftframework").'<i class="icon-angle-right"></i></a>';
    				}
    			
    				$post_item .= '</div>';
    			
    				// POST DETAILS 
    				if ($show_details == "yes") {
    				$post_item .= '<div class="post-item-details clearfix">';
    				$post_item .= '<span class="post-date">'.$post_date.'</span>';
    				$post_item .= '<div class="comments-likes">';
    				if ( comments_open() ) {
    				$post_item .= '<a href="'.$post_permalink.'#comment-area"><i class="icon-comments"></i><span>'. $post_comments .'</span></a> ';
    				}
    				if (function_exists( 'lip_love_it_link' )) {
    				$post_item .= lip_love_it_link(get_the_ID(), '<i class="icon-heart"></i>', '<i class="icon-heart"></i>', false);
    				}
    				$post_item .= '</div>';				
    				$post_item .= '</div>';
    				}
    				
    			// MINI STYLING
    			} else if ($blog_type == "mini") {
    			
    				$post_item .= $item_figure;
    			
    				$post_item .= '<div class="blog-details-wrap">';
    				
    				if ($show_title == "yes") {
    				if ($post_format == "link") {
    				$post_item .= '<h3>'.sf_link_post($postID).'</h3>'; 	
    				} else {
    				$post_item .= '<h3><a href="'.$post_permalink.'">'. $post_title .'</a></h3>';
    				}				
    				}	
    				
    				if ($show_details == "yes") {
    		$post_item .= '<div class="blog-item-details">'. sprintf(__(' on %1$s', 'swiftframework'),  $post_date).'</div>';
    				
    				$post_item .= '<div class="comments-likes">';
    				if ( comments_open() ) {
    					$post_item .= '<a href="'.$post_permalink.'#comment-area"><i class="icon-comments"></i><span>'. $post_comments .'</span></a> ';
    				}
    				if (function_exists( 'lip_love_it_link' )) {
    					$post_item .= lip_love_it_link(get_the_ID(), '<i class="icon-heart"></i>', '<i class="icon-heart"></i>', false);
    				}
    				$post_item .= '</div>';
    				}
    				if ($show_excerpt == "yes") {
    				if ($post_format == "quote") {
    					$post_item .= '<div class="quote-excerpt heading-font">'. $post_excerpt .'</div>';
    				} else {
    					$post_item .= '<div class="excerpt">'. $post_excerpt .'</div>';
    				}
    				}
    				
    				if ($show_read_more == "yes") {
    				$post_item .= '<a class="read-more" href="'.$post_permalink.'">'.__("Read more", "swiftframework").'<i class="icon-angle-right"></i></a>';
    				}
    				
    				$post_item .= '</div>';
    			
    			// STANDARD STYLING
    			} else {
    				
    				$post_item .= '<div class="row">'; // open row
    				
    				if ($sidebars == "no-sidebars") {
    				$post_item .= '<div class="standard-post-author span1">';
    				if(function_exists('get_avatar')) {
    				$post_item .= '<div class="author-avatar">'. get_avatar(get_the_author_meta('ID', $post_author_id), '164') .'</div>';
    				}
    				$post_item .= '<span class="standard-post-author-name">'.__("Posted by", "swiftframework").' '.$post_author.'</span>';
    				$post_item .= '</div>';
    				} else if ($sidebars == "right-sidebar" || $sidebars == "left-sidebar" || $sidebars == "one-sidebar") {
    				$post_item .= '<div class="standard-post-author span1">';
    				if(function_exists('get_avatar')) {
    				$post_item .= '<div class="author-avatar">'. get_avatar(get_the_author_meta('ID', $post_author_id), '164') .'</div>';
    				}
    				$post_item .= '<span class="standard-post-author-name">'.__("Posted by", "swiftframework").' '.$post_author.'</span>';
    				$post_item .= '</div>';
    				}
    				
    				$post_item .= '<div class="standard-post-content '.$standard_post_width.'">'; // open standard-post-content
    			
    				if ($post_format == "quote") {
    					$post_item .= '<div class="quote-display"><i class="icon-quote-left"></i></div>';
    				} else {
    					$post_item .= $item_figure;
    					if ($show_title) {
    					if ($post_format == "link") {
    					$post_item .= '<h2>'.sf_link_post($postID).'</h2>'; 	
    					} else {
    					$post_item .= '<h2><a href="'.$post_permalink.'">'. $post_title .'</a></h2>';
    					}
    					}
    				}
    				
    				if ($show_excerpt == "yes") {					
    				if ($post_format == "quote") {
    					$post_item .= '<div class="quote-excerpt heading-font">'. $post_excerpt .'</div>';
    				} else {
    					$post_item .= '<div class="excerpt">'. $post_excerpt .'</div>';
    				}
    				}
    				
    				if ($show_read_more == "yes") {
    				$post_item .= '<a class="read-more" href="'.$post_permalink.'">'.__("Read more", "swiftframework").'<i class="icon-angle-right"></i></a>';
    				}
    			
    				$post_item .= '</div>'; // close standard-post-content
    				
    				if ($show_details == "yes") {
    					$post_item .= '<div class="standard-post-details span1">'; // open standard-post-details
    					if ($sidebars == "both-sidebars") {
    					$post_item .= '<div class="standard-post-author">';
    					if(function_exists('get_avatar')) {
    					$post_item .= '<div class="author-avatar">'. get_avatar(get_the_author_meta('ID', $post_author_id), '164') .'</div>';
    					}
    					$post_item .= '<span class="standard-post-author-name">'.__("Posted by", "swiftframework").' '.$post_author.'</span>';
    					$post_item .= '</div>';
    					}
    					$post_item .= '<span class="standard-post-date">'.$post_date.'</span>';
    					$post_item .= '<div class="comments-likes">';
    					
    					if ( comments_open() ) {
    						$post_item .= '<div class="comments-wrapper"><a href="'.$post_permalink.'#comment-area"><i class="icon-comments"></i><span>'. $post_comments .'</span></a></div>';
    					}
    					
    					if (function_exists( 'lip_love_it_link' )) {
    						$post_item .= lip_love_it_link(get_the_ID(), '<i class="icon-heart"></i>', '<i class="icon-heart"></i>', false);
    					}
    					
    					$post_item .= '</div>';
    					$post_item .= '</div>'; // close standard-post-details
    				}
    				
    				$post_item .= '</div>'; // close row
    				
    			}		
    			
    			return $post_item;
    		}

    Thanks
    Mohammad

    #258802
    frstrat
    Member
    Post count: 3

    That got me where I need to be. Thanks again!

    #258803
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You most welcome and glad to help you.
    Thanks
    Mohammad

Viewing 5 posts - 1 through 5 (of 5 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