Tagged: ismael
-
AuthorPosts
-
January 9, 2017 at 4:41 pm #731190
Hi all,
For a travel agency site I have created a CPT “Tours” and am displaying tour lists with the Masonry component. To make the excerpt more striking for visitors, I am using html markup in excerpts. See here : https://ethiopiatropicaltours.com/ethiopia-tours-history-culture/
I have just tried to upgrade to Enfold 3.8.4 and bad surprise…. The html markup has disappeared.
See here (a copy of the live site, with just the theme upgraded) : https://test.ethiopiatropicaltours.com/ethiopia-tours-history-culture/For my customer it is not an option to lose this markup.
Please help, thanks !
BérangèreJanuary 11, 2017 at 6:53 pm #732223Hey Christophe,
Please post us your login credentials (in the “private data” field), so we can take a look at your backend.
Login credentials include:
- The URL to the login screen.
- A valid username (with full administration capabilities).
- As well as a password for that username.
- permission to deactivate plugins if necessary.
Best regards,
AndyJanuary 11, 2017 at 7:46 pm #732263Here you are.
It is a test site, feel free to perform any actions needed.FYI, I have tested on the parent theme, with all plugins disabled, unsing standard posts and not CPTs. Same issue.
Thanks !
- This reply was modified 7 years, 11 months ago by caudebert.
January 16, 2017 at 7:22 am #733912Hi,
Thank you for the info.
Please try to modify the config-templatebuilder > avia-shortcodes > av-helper-masonry.php file, look for this code around line 443:
$this->loop[$key]['content'] = avia_backend_truncate($entry->post_content, apply_filters( 'avf_masonry_excerpt_length' , 60) , apply_filters( 'avf_masonry_excerpt_delimiter' , " "), "…", true, '');
.. replace it with:
$this->loop[$key]['content'] = $entry->post_content;
Let us know if this fixes the issue. If not, please post the FTP details here so that we can test it further.
Best regards,
IsmaelJanuary 16, 2017 at 8:47 pm #734358Hello Ismael,
I have opened “config-templatebuilder > avia-shortcodes > av-helper-masonry.php”, but dindn’t find the piece of code you are mentioning.
I provide you an FTP access to the test environment so you can have a look, test and change whatever you need.
Thanks
BérangèreJanuary 17, 2017 at 7:54 am #734529Hi!
Thank you for the info.
We modified line 436 instead.
$this->loop[$key]['content'] = strip_tags( $entry->post_excerpt );
to..
$this->loop[$key]['content'] = $entry->post_excerpt;
The html tags are stripped because it causes a lot of markup issues on some installations, especially when they’re not careful with the tags.
Best regards,
IsmaelFebruary 9, 2017 at 4:43 pm #744869Hello,
This workaround was working when you implemented it 3 weeks ago, but not any more. I have just updated WP and the theme to the latest versions in my test environment (where you made the change in the child theme) and html markup doesn’t show any more.
I have copied the config-templatebuilder folder to the child theme and re-applied the change at line 436 in av-helper-masonry.php, but it still doesn’t work.
More generally, having a custom version of the masonry shortcode is not a sustainable solution – it requires to test and potentially apply changes at each new version, even with a child theme.
This site is totally dependant on html markup in masonry excerpts, which are used in dozens of pages. I have recommended Enfold to my customer because all its features made it possible to build the site without any changes in the theme’s templates, thus limiting maintenance effort. I have trained my customer to update the site on her own, I just can’t go back to her and tell her that it might not work well due to a custom template.
I am extremely annoyed and hope you will find a solution to restore the previous functionality in the standard version of the theme.
Thanks
Bérangère
February 15, 2017 at 7:45 am #747320Hey!
I’m sorry but you cannot override a shortcode template in a child theme. You need to do this modification in the parent theme folder.
Best regards,
IsmaelFebruary 15, 2017 at 10:32 am #747401Hello Ismael,
I a extremely frustrated and disappointed by this answer.
Root cause of my issue : The Enfold team’s decision to remove a functionality : hmtl tags in Masonry excerpts.
Unfortunately for me, I have just built for a customer a website which heavily relies on this fonctionality. Have a look at https://ethiopiatropicaltours.com and you’ll understand.
Changing the shortcode in the parent theme is against all recommended WordPress practises and means that the customer will never be able to update the site on her own.
As I mentioned in my previous message, this places me in a very difficult situation with my customer. I can’t leave her alone with that issue, and cannot also not perform additional maintenance or rebuild work for free.
I hope you will be able to provide a workable and sustainable solution.
Bérangère
February 16, 2017 at 8:28 am #747831Hey!
Have you tried the following method?
Yes, I understand the issue fully and as frustrating as this may sound, the suggestion that we provided previously is the only solution to the problem. A lot of issues have been reported before regarding the masonry element and more often than not, it’s because of the html tags which is why it is disabled.
Regards,
IsmaelApril 3, 2017 at 1:19 pm #771093Hi guys,
Reply #734529 by Ismael worked for me!
Thanks very much for providing this edit.
April 4, 2017 at 6:58 am #771539April 7, 2017 at 9:26 am #773791Hello,
first I try to change line 443, than I changed 436 as described. But both solution didn’t work for me with 4.0.5 :-(I want to set all photos and text in the same size. So I need to insert breaks to create 2 text line in every excerp. Do you have another workaround or a solution, now?
Thanks for help
GuidoApril 11, 2017 at 3:21 am #775754Hi!
Please revert the modifications back to default then follow this post.
// https://kriesi.at/support/topic/html-markup-in-excerpt-has-been-lost/#post-734529
Cheers!
IsmaelApril 11, 2017 at 2:42 pm #776059Hi Ismael,
I try this again and now it works. Thanks.Guido
April 12, 2017 at 5:27 am #776440April 19, 2017 at 6:54 pm #780085Hello Kriesi team,
I have applied the method suggested by Ismael on Feb 16 and it worked. I have been able to apply the codes changes via a child theme.
Unfortunately, I have issues again since I upgraded to Enfold 4.0. As I noticed that “av-helper-masonry.php” has been changed, I reapplied the code changes in my child theme based on the new version.
And now, I have double line breaks, as visible here : https://test.ethiopiatropicaltours.com/ethiopia-tours-history-culture/
It is not an option to remain with the previous version of “av-helper-masonry.php” because sooner of later I will have issues….
Please help,
BérangèreApril 20, 2017 at 6:12 am #780310Hey!
Please remove the line break tags because there’s a margin on top and bottom of the paragraph tags by default.
p { margin: 0.85em 0; }
Regards,
IsmaelApril 20, 2017 at 11:06 am #780444Hi Ismael,
I cannot remove these line breaks because are not in the HTML code of my excerpts. They are created by the new Enfold version. I have switched back to the former theme version and no <br> shows in the code.
For example, here is the html code of the tour “Historic North Road”
<p><u>Easy</u> – 10 days, 9 nights</p>
<p>A classical tour of North Ethiopia. Visit the fabulous sites of Axum, Gondar and Lalibela. Enjoy sceneries, nature, endemic animals and the charming Ethiopian people.</p>and see the outcome here at the bottom of the page : https://test.ethiopiatropicaltours.com/
I think that the code change that you have provided above needs to be adapted for the new release.
Cheers
Bérangère- This reply was modified 7 years, 8 months ago by caudebert. Reason: fix typos
April 21, 2017 at 6:33 am #780985Hi!
Remove the spaces between the paragraph tags. Look at the excerpt box of the following post for example. ( see private field)
Regards,
IsmaelJanuary 14, 2020 at 8:46 pm #1173619I have same problem. Can’t add HTML tags to excerpt in masonry.
Is Isamel tip still valid for 4.6.3.1 version?January 17, 2020 at 1:07 pm #1175359Hi,
@MusicalFactory: Yes, you have to modify the enfold\config-templatebuilder\avia-shortcodes\av-helper-masonry.php file as suggested previously.// https://kriesi.at/support/topic/html-markup-in-excerpt-has-been-lost/#post-734529
Best regards,
IsmaelJanuary 17, 2020 at 1:43 pm #1175393For information, I have sorted it out with the above solution but need to check the php file for each new release, whicn is really a hassle.
- This reply was modified 4 years, 11 months ago by caudebert.
January 17, 2020 at 1:45 pm #1175394Hey,
You can add following code to bottom of Functions.php file in Appearance > Editor to use HTML in Masonry excerpt
apply_filters( 'avf_masonry_slideshow_excerpt', strip_tags( $entry->post_excerpt ), $entry, $this->entries );
Best regards,
YigitJanuary 17, 2020 at 2:17 pm #1175434Hey Yigit,
I have entered this code in functions.php of my child theme and it triggers a critical error.Berangere
January 17, 2020 at 2:34 pm #1175441Hi,
Sorry about that, that was a misunderstanding on my end.
Could you please replace enfold/config-templatebuilder/avia-shortcodes/av-helper-masonry.php file with this one – https://pastebin.com/Qb1FGEmu via FTP or in Appearance > Editor if WP dashboard is loading?
If you would like us to update the file for you, please post FTP or WP admin logins here privately :)
Best regards,
YigitJanuary 17, 2020 at 2:47 pm #1175450Hi Yigit,
I have already implemented this. Via a child theme and not in the parent theme.
It works but requires to check the file for each now release.
A robust solution, with a filter in the child theme would be much appreciated.Best regards
BérangèreJanuary 17, 2020 at 2:53 pm #1175453Hi,
We are going to add a filter to use in a child theme in upcoming version :)
Best regards,
YigitJanuary 17, 2020 at 3:10 pm #1175470Great news. I will give you a feedback here.
BérangèreJanuary 17, 2020 at 3:11 pm #1175472 -
AuthorPosts
- The topic ‘HTML markup in excerpt has been lost’ is closed to new replies.