Avada Forums Community Forum Post card element does not distinguish post format

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • davidextre
    Participant
    Post count: 2

    I would need that when I design a post card in it, it would be possible to distinguish if the post has video, audio, gallery format… with a css class that it carries in the main container, it would be enough to be able to design customized post cards according to its format.
    Is there a way to make this possible?
    Thank you so much

    davidextre
    Participant
    Post count: 2

    I answer in case it is worth to someone.
    Add this function to functions.php

    function add_chat_class_to_title( $title, $id = null ) {
    if( get_post_format( $id ) == ‘video’ ) {
    $title = ‘<span class=”video”>’ . $title . ‘</span>’;
    }
    return $title;
    }
    add_filter( ‘the_title’, ‘add_chat_class_to_title’, 10, 2 );

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