Tagged: error, link post type
-
AuthorPosts
-
October 5, 2023 at 3:23 am #1421436
My ALB post element displays the following error on the frontend:
Warning: preg_replace(): Unknown modifier ‘<‘ in /home/tegmedia/public_html/lowestofthelow.com/site/wp-content/themes/enfold/includes/helper-post-format.php on line 315
when I include a post for which I’ve set “Link” as the post type. If I set the post to “Standard” type, I don’t see this error.
This post is configured without ALB, non block editor. The first line in the post is the link, but I have modified the visible text of the link.
October 5, 2023 at 5:34 am #1421448Hey ilowelife,
Thank you for the inquiry.
Did you modify the file? Looks like there is an error around line 315. Please download the latest version of the theme, get a copy of the includes/helper-post-format.php then override the current file. Let us know if this helps.
Best regards,
IsmaelOctober 5, 2023 at 6:52 am #1421456Hello @Ismael.
No, I did not replace the file. I re-uploaded the file from the source and the error continues to appear if the post type is set to link.
I’ve tested further and the error only occurs with link type posts. Any other post format is fine.The content of the post is:
<a href="https://www.merchsmerch.com/" target="_blank" rel="noopener">Online Merch from Lowest of the Low!</a> Mugs? <strong>Check!</strong> T-shirts? <strong>Check!</strong> Keychains, hoodies, posters, pins, hats, toques, and more! [av_button label='Go Shopping!' icon_select='yes' icon='ue859' font='entypo-fontello' link='manually,https://www.merchsmerch.com/' link_target='_blank' size='small' position='center' label_display='' title_attr='' size-text='' av-desktop-font-size-text='' av-medium-font-size-text='' av-small-font-size-text='' av-mini-font-size-text='' margin='' margin_sync='true' padding='' padding_sync='true' av-desktop-margin='' av-desktop-margin_sync='true' av-desktop-padding='' av-desktop-padding_sync='true' av-medium-margin='' av-medium-margin_sync='true' av-medium-padding='' av-medium-padding_sync='true' av-small-margin='' av-small-margin_sync='true' av-small-padding='' av-small-padding_sync='true' av-mini-margin='' av-mini-margin_sync='true' av-mini-padding='' av-mini-padding_sync='true' color_options='' color='theme-color' custom_bg='#444444' custom_font='#ffffff' btn_color_bg='theme-color' btn_custom_grad_direction='vertical' btn_custom_grad_1='#000000' btn_custom_grad_2='#ffffff' btn_custom_grad_3='' btn_custom_grad_opacity='0.7' btn_custom_bg='#444444' btn_color_bg_hover='theme-color-highlight' btn_custom_bg_hover='#444444' btn_color_font='theme-color' btn_custom_font='#ffffff' btn_color_font_hover='white' btn_custom_font_hover='#ffffff' border='' border_width='' border_width_sync='true' border_color='' border_radius='' border_radius_sync='true' box_shadow='' box_shadow_style='0px,0px,0px,0px' box_shadow_color='' animation='' animation_duration='' animation_custom_bg_color='' animation_z_index_curtain='100' hover_opacity='' sonar_effect_effect='' sonar_effect_color='' sonar_effect_duration='1' sonar_effect_scale='' sonar_effect_opac='0.5' css_position='' css_position_location=',,,' css_position_z_index='' av-desktop-css_position='' av-desktop-css_position_location=',,,' av-desktop-css_position_z_index='' av-medium-css_position='' av-medium-css_position_location=',,,' av-medium-css_position_z_index='' av-small-css_position='' av-small-css_position_location=',,,' av-small-css_position_z_index='' av-mini-css_position='' av-mini-css_position_location=',,,' av-mini-css_position_z_index='' id='' custom_class='' template_class='' element_template='' one_element_template='' av_uid='av-2gs7zi' sc_version='1.0' admin_preview_bg='']
October 5, 2023 at 7:23 am #1421458Hi,
Thank you for the info.
We created a post with link format, but we were not able to reproduce the same issue on our end. Please provide the WP and S/FTP details in the private field so that we can check the issue further.
Best regards,
IsmaelOctober 5, 2023 at 3:03 pm #1421495Hello. I’m not permitted to give you s/ftp access to the site (I don’t own access to the server).
However, I tried an experiment on another Enfold site I manage:
- created a post with link format. used THE EXACT SAME POST CONTENT as I shared above (I copy and pasted from the text tab of the standard WP post editor)
- created a test page, enabled ALB
- added a Blog Posts element from ALB to test page
- published and viewed
Result
I get the same error message on this site.So, I played around a bit more. The issue seems to be with the link itself:
Online Merch from Lowest of the Low!
If this link is the first line in the post, then it produces the error message.
If any non-space character precedes the link, (I tried an entity), then the error doesn’t happen. So, if I wrap the link in a <p> element it’s fine.I think your regex musn’t be happy with the starting < character it encounters as the first line of the string.
If I get a chance I’ll try this on a clean install, but perhaps you could test at your end?
- This reply was modified 1 year, 1 month ago by ilowelife.
October 6, 2023 at 11:09 am #1421612Hi,
Thank you for investigating the issue further.
When we do this on our end, the error doesn’t occur but the whole link is applied as the post title. What happens when you remove the a or link tag and just add the URL at the very beginning of the content?
https://www.merchsmerch.com/ Mugs? <strong>Check!</strong> T-shirts? <strong>Check!</strong> Keychains, hoodies, posters, pins, hats, toques, and more!
Best regards,
IsmaelOctober 6, 2023 at 4:30 pm #1421672Yes, that’s consistent with what I saw. In fact, the reason I changed the link text was because of the behaviour you describe. I didn’t want the URL to be the title of the post in the ALB blog list.
For the time being, I’ve thrown in a non breaking space entity to prevent the error from appearing.
October 9, 2023 at 5:37 am #1421862 -
AuthorPosts
- You must be logged in to reply to this topic.