Tagged: ,

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #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
    Soltner

    #1313796

    Hey 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,
    Ismael

    #1313866

    Hi Ismael!

    Thanks for your reply – I’ve already tried, unfortunately it doesn’t work – see screenshot

    Best regards,
    Soltner

    #1314334

    Hi,

    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,
    Ismael

    #1314339

    Hi 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,
    Soltner

    #1314788

    Hi,

    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,
    Ismael

    #1314815

    Hi 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,
    Soltner

    #1315193

    Hi,

    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,
    Ismael

    #1315788

    Hi,

    thanks for the feedback – see login details in private field…

    Best regards,
    Soltner

    #1315974

    Hi,

    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,
    Ismael

    #1315978

    Hi Ismael,

    thank you very much for the solution!

    Have a great day :-)
    Best regards,
    Soltner

    #1316094
    This reply has been marked as private.
    #1316271
    This reply has been marked as private.
    #1316551

    Hi,

    Sorry about that. We forgot to remove variable dump. It should be located in the avf_masonry_entry_content filter. Just remove any line of code that resembles the following.

    echo '<pre>' . var_export(, true) . '</pre>';
    

    Best regards,
    Ismael

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