Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1318164

    Hi,
    I have a tricky problem. I am working with portfolios and excerpts.
    The are shown in a masonry on a page. Everything okay.
    In the excerpt I will use a <span>
    I tried it with this in the excerpt part:
    SPORTLICHES SET
    <span class=”euro_price”>799,95 €</span>
    And in my css I wanted to make the like: .euro_price { display:none; }

    BUT the span class is not visible on the final page (source code). It looks like:
    <div class=”av-masonry-entry-content entry-content” itemprop=”text”>SPORTLICHES SET<br>
    799,95 €</div>
    Any idea how I can solve this or what am doing wrong?
    Thank you for any help!
    Barbara

    #1318389

    Hey walhai,

    Thank you for the inquiry.

    The theme automatically strips html tags from the masonry excerpt, so you will not be able to add the span tags without modifying the theme. You could try this filter in the functions.php file but we are not sure if this will help return the unmodified excerpt.

    add_filter("avf_masonry_entry_content", function($content, $entry, $atts) {
        return $entry->post_content;
    }, 10, 3);
    

    Best regards,
    Ismael

    #1318426

    Hi Ismael,
    thank you, did not work for me. If I use it, it does not show me the excerpt content.

    I found another solution:
    We copied the file av-helper-masonry.php in our child-theme and changed
    $loop_excerpt = strip_tags( $entry->post_excerpt );
    to
    $loop_excerpt = ( $entry->post_excerpt );
    Now it works. Do you think this could give any problems anywhere or in future?
    Maybe this helps anybody else too.
    Thank you and best regards
    Barbara

    #1318628

    Hi,

    Nice to know that you have found a different solution. The filter above could actually accomplish the same thing. Just replace post_content with post_excerpt.

    add_filter("avf_masonry_entry_content", function($content, $entry, $atts) {
        return $entry->post_excerpt;
    }, 10, 3);
    

    This should return the unmodified version of the excerpt without the tags stripped.

    If the filter above is not working, try to check if this same exact line exists in the enfold/config-templatebuilder/avia-shortcodes/av-helper-masonry.php file (line 607).

    $content = apply_filters( 'avf_masonry_entry_content', $content, $entry, $this->atts );
    

    Best regards,
    Ismael

    #1318654

    Hi Ismael,
    thank you! I tried your solution to put the filter in the function.php. The code is right on line 607 in the av-helper-masonry.php.
    If I do this the whole excerpt is not visible :((
    Regards Barbara

    #1318881

    Hi,

    Do you see the $entry parameter in the filter?

    $content = apply_filters( 'avf_masonry_entry_content', $content, $entry, $this->atts );
    

    This parameter was recently added on version 4.8.6.1, if I am not mistaken.

    Best regards,
    Ismael

    #1318926

    Hi,
    thank you for your answer, yes I have the $entry parameter.
    I checked my av-helper-masonry.php and there is exactly the code:
    $content = apply_filters( ‘avf_masonry_entry_content’, $content, $entry, $this->atts );
    I am working with Version: 4.8.6

    Regards Barbara

    #1319447

    Hi,

    Odd. You may need to keep the template modifications for now. Thank you for your patience.

    Best regards,
    Ismael

    #1319515

    Okay – no problem :))
    Thank you!

    #1319694

    Hi,

    Thanks for the update. Please let us know if you should need any further help on the topic.

    Best regards,
    Rikard

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