Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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">  &rarr;</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.
    #353985

    Hi 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,
    Elliott

    #354241

    Thanks 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?

    #354427

    Hi!

    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!
    Elliott

    #355210

    Thanks 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…

    #355649

    Hey!

    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,
    Elliott

    #355858

    Awesome! :) Thank you very, very much.

    This can be closed now.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Tag page with excerpt and featured image’ is closed to new replies.