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

    #1451925

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

    #1451937

    Nice — 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!

    #1451938

    it 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);
    #1451939

    Thanks 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?

    #1451941

    I’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.

    #1451965

    well: 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/

    #1452033

    Thanks 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!!

    #1452950

    Hi,
    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

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘add categories to default (business) style blog post element grid layout’ is closed to new replies.