Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1248350

    Hi again,

    I activated „show category“ in enfold–blog–settings, but categories do not show in blog slider and blog posts element (don’t how how they are exactly called in Englisch, in German: Avia Content Elements named “Blog Beiträge” and “Beitrag-Slider”)
    Any idea? Could you please have a look at this?
    Kind regards
    Ursula

    #1248661

    Hey chefsmagazin,

    That setting works on the single posts if they are built with the Classic editor and you seem to be building blog posts with the Advanced Layout Builder, and they do not show up.

    Please have a look at the following thread:
    https://kriesi.at/support/topic/post-using-advanced-editor-how-to-insert-post-meta-info-title-date-etc/

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1249280

    Hi,
    I found this code in the thread and copied it to child functions.php and it seems to work :

    ——-
    function post_category_shortcode(){
    global $post;
    $categories = get_the_category($post->ID);
    $separator = ‘ ‘;
    $output = ”;
    if ( ! empty( $categories ) ) {
    foreach( $categories as $category ) {
    $output .= ‘term_id ) ) . ‘” alt=”‘ . esc_attr( sprintf( __( ‘View all posts in %s’, ‘textdomain’ ), $category->name ) ) . ‘”>’ . esc_html( $category->name ) . ‘‘ . $separator;
    }

    }
    return trim( $output, $separator );
    }
    add_shortcode( ‘sc_post_category’, ‘post_category_shortcode’ );
    ——

    But where do I have to place the shortcode [sc_post_category] to make it show the categogy besides the date right under the headlines? I provided a link to files where I visualized this (example with “Blog Beiträge” element).

    Kind regards, Ursula

    #1249653

    Hi Ursula,

    You need to edit the post slider file, in this thread, you can see where to add the code:

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1249987

    Hi, I am sorry but the provided thread is not helpful for me … just seems to leads to another thread and another thread. Could you please provide just the proper code snippet and where to place it exactly? Thank you so much in advance, Ursula

    #1250833

    Hi,

    Thank you for the update.

    We need to modify the enfold\config-templatebuilder\avia-shortcodes\postslider\postslider.php file, and add the code around line 898 where the time info is located.

    $meta .= "<time class='slide-meta-time updated' $markup>" . get_the_time( get_option( 'date_format' ), $the_id ) . '</time>';
    

    Below that code, we could add the custom shortcode for the category.

    $meta .= '<span class="slide-meta-categories">'.do_shortcode("[sc_post_category]").'</span>';
    

    Best regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.