-
AuthorPosts
-
June 19, 2024 at 2:42 am #1451910
Hey, what’s the latest re getting categories to show in the Default (Business) style blog post element grid layout — is there a filter for that, yet, or do we still have to use Elegant or Modern Business to get categories to show?
If you scroll down to Latest News & Events on https://century.org/ you should see the element I’m working on, with only dates showing for the posts meta. My client much prefers having the dates show between the title and the excerpt, so it’d be great if we could get the categories to show in that Default (Business) style (plus, I’ve already customized the css for that style ;).
Thanks and lmk if you have any questions.
June 19, 2024 at 6:33 am #1451925Hey sky19er,
Thank you for the inquiry.
You can add this filter to the functions.php file to always show the post categories:
add_filter('avf_postslider_show_catergories', 'avf_postslider_show_catergories_mod', 10, 1); function avf_postslider_show_catergories_mod($category) { $show_cats = 'show_business'; return $show_cats; }
Best regards,
IsmaelJune 19, 2024 at 8:36 am #1451937Nice — thanks, Ismael! It looks like this is adding it to the entry-content-header, above the date/slide-meta — (see https://capture.dropbox.com/n0V8ei2BrNWlpnaG or Latest News on https://century.org/ ) — Is it too hard to get it in the same line as the date (like on the single posts) or below the date? Thanks again!
June 19, 2024 at 8:38 am #1451938it works the way Ismael said above.
On Blog Layout – Blog Meta Elements you have that options to show – or not to show those meta Infos.
If you like to have that snippet of ismael depending on that setting you can use instead:function avf_postslider_show_catergories_mod($category) { if('blog-meta-category' == avia_get_option('blog-meta-category')){ $show_cats = 'show_business'; return $show_cats; } } add_filter('avf_postslider_show_catergories', 'avf_postslider_show_catergories_mod', 10, 1);
June 19, 2024 at 8:43 am #1451939Thanks Guenni — that’s cool — Do you know how to get the categories to show in the same line as the date (like on the single posts) or below the date?
June 19, 2024 at 8:53 am #1451941I’m afraid it won’t be that easy without a child-theme postslider.php. The category metas are part of entry-content-header – the rest of the meta info is in slide-meta.
With javascript you can move it there afterwards, but the method of placing it there when it is created would certainly be more elegant.June 19, 2024 at 11:28 am #1451965well: I don’t think it’s so bad that the categories are separated from the rest of the meta info.
_________________
but here we go:
if you choose the way over a child-theme postslider.php – then you do not need that snippet above!see her on paste.bin. : https://pastebin.com/fEtjrb6K
since lines 1211 – for the case that there are meta-content and not elegant nor modern blogstyle:
if( !empty( $meta_content ) && (strpos( $new_blogstyle, 'elegant-blog' ) === false ) && ('blog-meta-category' == avia_get_option('blog-meta-category')) ) { $meta = '<div class="slide-meta">'; $meta .= $meta_out; $meta .= ' | '; $meta .= $meta_content; $meta .= '</div>'; }
Please be gentle with my code. It’s probably better to include this, maybe a developer here is willing to offer a more elegant code.
you know how to use child-theme alb elements?
see here a default blog with that edited postslider.php: https://webers-testseite.de/blog/
June 19, 2024 at 8:01 pm #1452033Thanks again, Guenni! I’m running the simpler solution by my client — I think it will suffice, but I sure do appreciate you providing these options! And thank you again, Ismael — very much appreciated!!
June 20, 2024 at 11:05 pm #1452950Hi,
Glad Guenni007 & Ismael could help, thank you Guenni007, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘add categories to default (business) style blog post element grid layout’ is closed to new replies.