i want to change the related post style to grid. please help me.
Hey Vadivel,
Thank you for using Enfold.
Edit the single.php file and look for this code around line 46:
//show related posts based on tags if there are any
get_template_part( 'includes/related-posts');
Get the tags of the posts and set them as the value of an attribute of the blog posts shortcode:
global $post;
$tags = wp_get_post_tags($post->ID);
foreach ($tags as $tag) {
$post_tags[] = $tag->term_id;
}
echo do_shortcode("[av_blog blog_type='taxonomy' link='post_tag,".implode(',', $post_tags)."' blog_style='blog-grid' columns='3' contents='excerpt' content_length='content' preview_mode='auto' image_size='portfolio' items='3' offset='0' paginate='yes']");
Best regards,
Ismael
Hi Ismael,
Thanks for the solution, i have applied the shortcode but, same post is also listing in the grid post. please help me.
Hi,
Thanks for the update.
Use this filter in the functions.php file to exclude the current post.
add_filter('avia_post_slide_query','avia_post_slide_query_mod', 10, 2);
function avia_post_slide_query_mod($query, $params)
{
if(is_singular('post')) {
$query['post__not_in'] = array(avia_get_the_ID());
}
return $query;
}
Best regards,
Ismael
Thanks Its working fine.
Please Help me how i can add heding top of related post like related content.