![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
-
AuthorPosts
-
January 10, 2019 at 9:43 am #1052252
How can I create a tag Archive that displays all posts in that tag using a grid?
Now if I click a tag, it shows all posts in chronological order and hundreds of pages, I want to have a grid.
Thank you.
January 11, 2019 at 12:45 pm #1052727Anything about this?
January 14, 2019 at 12:16 am #1053459Hi,
Thank you for using Enfold.
You have to set the Enfold > Blog Layout > Blog Layout settings to “Grid Layout” or use the “avf_blog_style” filter to set the blog style to “grid” when viewing an archive page.
Best regards,
IsmaelJanuary 14, 2019 at 9:43 am #1053583Can you please share how to use the “avf_blog_style” filter to set the blog style to “grid” when viewing an archive page.?
That means “only” categories, dates, tags will look like that, and the blog as usual, correct?
Thank you.
January 14, 2019 at 9:53 am #1053586both here either tag or archive:
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; } add_filter('avf_blog_style','avia_change_category_blog_layout', 10, 2); function avia_change_category_blog_layout($layout, $context){ if($context == 'archive') $layout = 'blog-grid'; return $layout; }
January 14, 2019 at 10:05 am #1053591Thank you. How to remove the sidebar as well ?
January 14, 2019 at 11:59 am #1053619Get rid of sidebar – where – on all archive pages or only for some category pages ?
January 14, 2019 at 12:00 pm #1053620The same as before in some pages, tag and archive for example.
Thank you.
January 14, 2019 at 12:29 pm #1053630there was a filter – you can adjust via if clauses to your needs:
add_filter('avia_layout_filter', 'avia_change_category_layout', 10, 2); function avia_change_category_layout($layout, $post_id) { if( is_category('grafik') ){ $layout['current'] = $layout['fullsize']; $layout['current']['main'] = 'fullsize'; } return $layout; }
January 14, 2019 at 12:33 pm #1053634and by the way if you like to exclude the layout for archiv-page and all the post in it you can use has_category()
if( is_category('grafik') || has_category('grafik') ){
hm seems not to work in that supposed manner.
I will brainstorm again. …Edit: it seems to be this way that the layout of the category will go to the post in that category !
But you can bypass it by f.e.
(maybe a mod knows a different setting – quiet shorter):add_filter('avia_layout_filter', 'avia_change_category_layout', 10, 2); function avia_change_category_layout($layout, $post_id) { if( is_category('grafik') && is_archive() ){ $layout['current'] = $layout['sidebar_right']; $layout['current']['main'] = 'sidebar_right'; } return $layout; } add_filter('avia_layout_filter', 'avia_change_post_layout', 10, 2); function avia_change_post_layout($layout, $post_id) { if( has_category('grafik') && !is_archive() ){ $layout['current'] = $layout['fullsize']; $layout['current']['main'] = 'fullsize'; } return $layout; }
so here the archive page of category: grafik will be with sidebar right – but the posts in it has no sidebar.
-
This reply was modified 5 years, 7 months ago by
Guenni007.
January 14, 2019 at 1:09 pm #1053656if you only want to extra style the category archive page but not the posts ( post then get standard layout set by Enfold options page):
add_filter('avia_layout_filter', 'avia_change_category_layout', 10, 2); function avia_change_category_layout($layout, $post_id) { if( is_category('grafik') && !has_category('grafik') ){ $layout['current'] = $layout['sidebar_right']; $layout['current']['main'] = 'sidebar_right'; } return $layout; }
just play a bit with both filters
June 6, 2019 at 7:23 pm #1108061Thank you.
I am now using this:
// tag y archive como grid 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; } add_filter('avf_blog_style','avia_change_category_blog_layout', 10, 2); function avia_change_category_blog_layout($layout, $context){ if($context == 'archive') $layout = 'blog-grid'; return $layout; } // tag y archive como grid
That shows categories and tags in grid with sidebar and is ok. (I will try the sidebar thing later)
I have 2 more problems.
1- How to remove the date?
2- Is there a way to choose the excerpt it shows under the titles?For number 2 the problem is that all of them start with “Description of the product” and then the description. The thing is that in the post itself it is ok and makes sense, but in grid all of them show “Description of the product” under the title, because is just a bit of text. So showing more text or making it start later can do the trick.
Thanks.
June 10, 2019 at 12:17 pm #1108796Hi,
1.) You should be able to remove the date in the Enfold > Blog Layout > Blog meta elements section. If you can’t remove it there, try to remove it using css code.
2.) It will show partial content of the post as the excerpt automatically. If you prefer, you can manually specify the summary in the posts’ Excerpt field.
Best regards,
IsmaelJune 11, 2019 at 4:12 pm #1109201hello,
no chance to list the archive the tag-page like the cat-page.
what can i do?bis dann, marco.
the code in /themes/enfold/functions.php:
// Archiv-Display
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;
}add_filter(‘avf_blog_style’,’avia_change_category_blog_layout’, 10, 2);
function avia_change_category_blog_layout($layout, $context){
if($context == ‘archive’) $layout = ‘blog-grid’;
return $layout;
}
// Archiv-DisplayJune 11, 2019 at 5:01 pm #1109215Thank you Ismael.
For 1) I have it unchecked in the options, but it is still showing. Is there a way to make that checkbox actually work ?
For 2) I will continue testing to see if I can get something to work.
Thanks.
June 13, 2019 at 11:33 am #1109827Hi,
1.) Try to remove the date manually with css.
time.date-container.minor-meta.updated, .text-sep-date { display: none !important; }
2.) Can we see an actual archive or category page from your site? Please post the URL in the private field.
Thank you for the update.
Best regards,
Ismael -
This reply was modified 5 years, 7 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.