Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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.
    #1351798

    Hey 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,
    Mike

    #1469367

    Hi 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.
    #1469448

    Hi,
    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:
    Screen Shot 2024 10 19 at 9.55.24 AM
    if you don’t like the button, change your blog style at Enfold Theme Options ▸ Blog Layout ▸ Blog Styling
    Screen Shot 2024 10 19 at 9.58.31 AM
    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',);

    Screen Shot 2024 10 19 at 10.10.38 AM
    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,
    Mike

    #1469532

    Thank you!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘How to edit category and tag archive page?’ is closed to new replies.