-
AuthorPosts
-
July 27, 2021 at 4:12 pm #1312780
Hello,
i am using the Advanced Custom Fields plugin and would like to ask whether it would be possible to insert the ACF-Shortcode, example [acf field = “abc”], in the excerpt field from the blog post?
Thanks,
kindly regards
SoltnerAugust 2, 2021 at 4:38 am #1313796Hey soltner,
Thank you for the inquiry.
Have you tried manually adding it in the posts’ Excerpt box? If you cannot find the excerpt box, make sure to enable it from the Screen Options, or from the block editor’s Options > Preferences > Panels > Document Settings.
Best regards,
IsmaelAugust 2, 2021 at 10:30 am #1313866Hi Ismael!
Thanks for your reply – I’ve already tried, unfortunately it doesn’t work – see screenshot
Best regards,
SoltnerAugust 4, 2021 at 10:59 am #1314334Hi,
Thank you for the screenshots.
We may need to modify the enfold/config-templatebuilder/avia-shortcodes/av-helper-masonry.php file and adjust this code around line 562 to properly render the shortcodes.
$items .= "<div class='av-masonry-entry-content entry-content' {$markup}>{$content}</div>";
Replace it with the following code.
$content = do_shortcode($content); $items .= "<div class='av-masonry-entry-content entry-content' {$markup}>{$content}</div>";
Best regards,
IsmaelAugust 4, 2021 at 11:20 am #1314339Hi Ismael!
Thanks for the feedback, I have inserted the code, the shortcode is no longer displayed, but neither is the price …
With this solution, I have to make this change after every theme update, correct? Or is there a way via child theme?
It would also be very helpful if the shortcode in question would be automatically inserted into each new post, would there be a possibility for this as well? Sorry, but these questions have now arisen …
Many thanks again for your GREAT support :-)
Best regards,
SoltnerAugust 6, 2021 at 10:02 am #1314788Hi,
Are you sure that the custom field is correct? We could also use the “avf_masonry_entry_content” filter to adjust the content without editing the shortcode file directly. Try to add this code in the functions.php file.
add_filter("avf_masonry_entry_content", function($content, $entry, $atts) { return do_shortcode($content); }, 10, 3);
It would also be very helpful if the shortcode in question would be automatically inserted into each new post
That should be possible but it will require modifications that are beyond the scope of support. You may need to hire a third party developer to add the feature.
Best regards,
IsmaelAugust 6, 2021 at 11:43 am #1314815Hi Ismael,
sure, the shortcode is also used elsewhere in the post.
I have now restored the enfold / config-templatebuilder / avia-shortcodes / av-helper-masonry.php and inserted the new code in the functions.php – unfortunately without success, nothing is displayed… (also with modified av-helper-masonry.php).
Best regards,
SoltnerAugust 9, 2021 at 4:07 am #1315193Hi,
Thank you for following up.
We may need to access the dashboard in order to check the issue further. Please post the login details in the private field, and make sure that the Appearance > Editor panel is accessible.
Best regards,
IsmaelAugust 9, 2021 at 8:48 am #1315788Hi,
thanks for the feedback – see login details in private field…
Best regards,
SoltnerAugust 10, 2021 at 7:50 am #1315974Hi,
Thank you for the info.
It works when we add the post_id parameter to the shortcode.
[acf field="preis" post_id="396"]
// https://www.advancedcustomfields.com/resources/shortcode/
Best regards,
IsmaelAugust 10, 2021 at 8:04 am #1315978Hi Ismael,
thank you very much for the solution!
Have a great day :-)
Best regards,
SoltnerAugust 10, 2021 at 4:04 pm #1316094This reply has been marked as private.August 11, 2021 at 2:04 pm #1316271This reply has been marked as private.August 13, 2021 at 7:24 am #1316551 -
AuthorPosts
- You must be logged in to reply to this topic.