Tagged: excerpt, featured image, tag page
-
AuthorPosts
-
November 19, 2014 at 5:08 pm #353795
Hi guys,
I want to change my tag page layout to match my posts page. I’ve found a function.php code here on the forum, which I have used to modify the page. This one:
add_filter('avf_blog_style','avia_change_archive_blog_layout', 10, 2); function avia_change_archive_blog_layout($layout, $context){ if($context == 'archive') $layout = 'single-small'; return $layout; } add_filter( 'post-format-standard', 'avia_category_content_filter', 15, 1); function avia_category_content_filter($current_post) { if(!is_single()) { $current_post['content'] = get_the_excerpt(); $current_post['content'] .= '<div class="read-more-link"><a href="'.get_permalink().'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow"> →</span></a></div>'; } return $current_post; }
For some reason it is not displaying the featured image and the blog category is shown (in Blog) which is disabled in Enfold options as it shouldn’t be displayed at all.
Blog: http://ariadpartners.com/blog/
Tag page: http://ariadpartners.com/tag/content-marketing/Can you help please?
- This topic was modified 9 years, 11 months ago by AriadPart.
November 19, 2014 at 10:05 pm #353985Hi AriadPart!
Instead of this.
add_filter('avf_blog_style','avia_change_archive_blog_layout', 10, 2); function avia_change_archive_blog_layout($layout, $context){ if($context == 'archive') $layout = 'single-small'; return $layout; }
Try this.
add_filter('avf_blog_style','avia_change_archive_blog_layout', 10, 2); function avia_change_archive_blog_layout($layout, $context){ if( is_tag() ) $layout = 'single-small'; return $layout; }
And add this to your custom CSS.
.tag-page-post-type-title { display: none !important; }
Regards,
ElliottNovember 20, 2014 at 12:24 pm #354241Thanks Elliott! :) It is much better now, the images are there. Only two minor fixes needed, take a look at this:
How can I remove the category? This is important.
Why is the image in a different size? Can it be the same size?
November 20, 2014 at 8:46 pm #354427Hi!
You can change the image size on line 100 in /enfold/functions.php.
$avia_config['imgSize']['square'] = array('width'=>180, 'height'=>180); // small image for blogs
And then use this plugin, https://wordpress.org/plugins/regenerate-thumbnails/, to update the images.
Add this to your custom CSS to get rid of the category.
.blog-categories.minor-meta, .text-sep-cat { display: none; }
Or you can remove it in Dashboard > Enfold > Blog Layout.
Cheers!
ElliottNovember 21, 2014 at 3:32 pm #355210Thanks again Elliott! The images are working perfect. :)
Sorry for not being clearer on the category part. I need that completely removed from the code, not only disabled by CSS. And yes, I already have it removed/disabled in Dashboard > Enfold > Blog Layout and that is why am I asking, since it’s disabled there but it’s still showing, I’m confused as to how it’s possible to remove it…November 21, 2014 at 10:47 pm #355649Hey!
Try deleting lines 166 – 171 in /enfold/includes/loop-index.php.
if(!empty($cats)) { echo '<span class="blog-categories minor-meta">'.__('in','avia_framework')." "; echo $cats; echo '</span><span class="text-sep text-sep-cat">/</span>'; }
Best regards,
ElliottNovember 22, 2014 at 12:02 pm #355858Awesome! :) Thank you very, very much.
This can be closed now.
-
AuthorPosts
- The topic ‘Tag page with excerpt and featured image’ is closed to new replies.