• Resolved degn

    (@degn)


    Hi

    Im using your plugin to generate a custom layout for apartment grids, and i have an issue with the excerpts.

    Is it possible to use a shortcode in the excerpt? Because i’ve created some custom meta boxes witch tells the amount of rooms the apratment has, the type of apartment and the price, and im able to export this information onto the post using a plugin called “Get Custom Field Values” which generates a shortcode for the specific meta box.

    But when i insert the shortcode in the excerpt it just comes out as the shortcode text and not the actual value im looking for.

    Im using a simple html structure for the excerpt so i can style each individual line.
    <p class=”lejlighed-type”>Type of apartment</p>
    <p class=”varelser”>How many rooms</p>
    <p class=”pris”><solid>Price</solid> Price value</p>

    I’ve also added this line in my functions.php file but it didn’t do anything:
    add_filter(‘the_excerpt’, ‘do_shortcode’);

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Code Amp

    (@codeamp)

    Hi degn

    I’m going to have a look into this.

    We should support the default WP behaviour, so I’ll test, and make sure we are aligned with that.

    I’ll likely have an update about this later on today or tomorrow.

    Thanks

    Thread Starter degn

    (@degn)

    The new update which has the custom fields integration sorted the issue. Just what i was looking for, thank you!

    Plugin Author Code Amp

    (@codeamp)

    Hey @degn

    Glad to hear you’re setup ok.

    I did double check this, and it looks like by default, the excerpt does not execute shortcodes – so we’ll be respecting that and leaving it as is.

    However, I did find this snippet which should allow shortcodes in excerpts should anyone need it:
    https://wordpress.stackexchange.com/a/42745/37783

    Best
    – Ross

    • This reply was modified 3 years, 8 months ago by Code Amp.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Shortcode in excerpt’ is closed to new replies.