Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #796203

    Hello,

    I’ve a plugin which converts currencies. I want to put the prices into the excerpt field of the masonry. The plugin works fine in the text fields. I’ve asked the author how to do and they said that I need to add do_shortcode function to the excerpt field.

    I’ve checked the forum and found several solutions which none worked.
    Solution by Peter

    Hi!
    Excerpts do not support shortcodes by default but you can use the do_shortcode() function to execute them even if wordpress does not support them in excerpts. In your case you need to modify /wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/portfolio.php – open up the file and replace

    $output .= !empty($excerpt) ? "<div class='grid-entry-excerpt entry-content' ".avia_markup_helper(array('context'=>'entry_content','echo'=>false)).">".$excerpt."</div>" : '';
    with
    $output .= !empty($excerpt) ? "<div class='grid-entry-excerpt entry-content' ".avia_markup_helper(array('context'=>'entry_content','echo'=>false)).">".do_shortcode($excerpt)."</div>" : '';
    Cheers!
    Peter

    and
    Solution by Elliott

    Hi Ben!

    It’s on line 473 in /enfold/config-templatebuilder/avia-shortcodes/portfolio.php.

    $output .= !empty($excerpt) ? "<div class='grid-entry-excerpt entry-content' ".avia_markup_helper(array('context'=>'entry_content','echo'=>false)).">".do_shortcode($excerpt)."</div>" : '';
    I just tried it and it seems to work fine. If it’s still not working for you then send us a link to your page and we’ll take a look.

    Cheers!
    Elliott

    Both changes nothing
    Solution by Elliott

    Hi!

    You could try doing the same on line 739 in the /enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php file.

    $this->loop[$key]['content'] = do_shortcode($entry->post_excerpt);
    Though I’m not sure it’s going to work the same in the Masonry. What type of content are you trying to add?

    Regards,
    Elliott

    But there is no line 739, it ends at 418.

    Solution by Vinay

    Hey dewasurya!
    Please add the below code in functions.php to enable shortcode in excerpts.

    add_filter('the_excerpt', 'do_shortcode');
    Best regards,
    Vinay

    Changes nothing.

    Solution from wadetaylornz

    I have added in the following line to the helper-masonry.php file.

    Line 406: $this->loop[$key][‘content’] = do_shortcode($entry->post_excerpt);

    With that shortcodes work. However, it only lets me enter in theme shortcodes, and it won’t display custom shortcodes. Is this code only meant to show avia shortcodes, or is it simply a matter of the custom shortcodes plugin not working properly in your opinion?

    Also, this has no effect.

    How can I let the wordpress process shortcodes in excerpt fields of the masonry portfolio?

    #797303

    Hey pavlika,

    To be honest with you, that is a very though modification
    Peter has provided a guidance which is the further we can go
    The best option is to consider to hire a freelancer who will be able to help you by follwing the directions provided and make it in a way to work through shortcodes from child theme.

    Best regards,
    Basilis

    #798559

    Thank you Basilis.

    #798742

    Hi,

    Thanks for the feedback, please let us know if you should have any further questions on the topic.

    Best regards,
    Rikard

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