-
AuthorPosts
-
August 24, 2021 at 6:34 pm #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!
BarbaraAugust 26, 2021 at 7:22 am #1318389Hey 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,
IsmaelAugust 26, 2021 at 11:00 am #1318426Hi 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
BarbaraAugust 27, 2021 at 11:38 am #1318628Hi,
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,
IsmaelAugust 27, 2021 at 2:37 pm #1318654Hi 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 BarbaraAugust 30, 2021 at 4:24 am #1318881Hi,
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,
IsmaelAugust 30, 2021 at 8:25 am #1318926Hi,
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.6Regards Barbara
September 2, 2021 at 8:11 am #1319447Hi,
Odd. You may need to keep the template modifications for now. Thank you for your patience.
Best regards,
IsmaelSeptember 2, 2021 at 1:49 pm #1319515Okay – no problem :))
Thank you!September 4, 2021 at 3:55 am #1319694 -
AuthorPosts
- You must be logged in to reply to this topic.