-
AuthorPosts
-
May 12, 2022 at 1:00 pm #1351552
Hello everyone,
I would like to change the category and tag archive pages to the style I use for my landing page. Is it possible to apply the blog grid layout to the archive pages?
I want the blog layout and the tag page to look the same. There is no thumbnail on the filtered page. How can I edit this?Thank you!
Cheers, Jens- This topic was modified 2 years, 7 months ago by Jens-abroad.
May 14, 2022 at 7:27 pm #1351798Hey Jens-abroad,
Thank you for your patience and for the login to your site, for the grid layout on your archive page and tag page I added this code to the end of your functions.php file in Appearance ▸ Editor:add_filter('avf_blog_style','avia_change_archive_blog_layout', 10, 2); function avia_change_archive_blog_layout($layout, $context){ if($context == 'archive') $layout = 'blog-grid'; return $layout; } add_filter('avf_blog_style','avia_change_tag_blog_layout', 10, 2); function avia_change_tag_blog_layout($layout, $context){ if($context == 'tag') $layout = 'blog-grid'; return $layout; }
so now the layout is grid with the images showing, but the css doesn’t match because the blog grid on your landing page is created by the plugin Gutenberg Blocks by Kadence Blocks
To have all of the grid styles match try building your landing page with the theme’s Advanced Layout Builder and use the blog element to show the posts.
Also, I recommend using a Child Theme and moving the functions.php code to the child theme so it will not be lost on your next theme update.Best regards,
MikeOctober 18, 2024 at 8:47 am #1469367Hi Mike,
what do I need to change in your code to define the layout as “Title and Excerpt + Read More Link”?Is it also possible to ad a submenu to those pages through this solution?
Thanks,
Christian- This reply was modified 2 months ago by atx_m.
October 19, 2024 at 4:16 pm #1469448Hi,
I removed the previse solution and edited your archive.php & tag.php and replaced this on line 63:'custom_query'=> array('post__in' => $post_ids,'post_type' => get_post_types())
with this:
'custom_query' => array( 'post__in'=>$post_ids),'contents' => 'excerpt_read_more',);
for this result:
if you don’t like the button, change your blog style at Enfold Theme Options ▸ Blog Layout ▸ Blog Styling
For your tag.php I replaced line 117:'custom_query' => array('post__in' => $post_ids,'post_type' => $key));
with:
'custom_query' => array( 'post__in'=>$post_ids, 'post_type'=> $key ),'contents' => 'excerpt_read_more',);
Please note that since you are not using a Child Theme these customizations will be lost when you update next. So it is best if you copy these files to your child theme after you install it.Best regards,
MikeOctober 21, 2024 at 7:09 am #1469532Thank you!
-
AuthorPosts
- The topic ‘How to edit category and tag archive page?’ is closed to new replies.