Etsy Shop
do_shortcode soesn't work (5 posts)

  1. kevleitch
    Posted 2 years ago #


    I need to use do_shortcode to execute the code from a custom template via custom fields. Here's what I'm doing:

    $shopSection = get_post_meta($post->ID, 'SS_id', true);
    $options = get_option('sample_theme_options');
    $shopName = $options['sometext'];
    echo do_shortcode( '[etsy-include=' . $shopName . ';' . $shopSection . ']' );

    This simply prints:


    to the page instead of being translated by WordPress.

    If I paste the same shortcode into the main content editor then it works fine so I know the shortcode is fine. The plugin is not processing it correctly.


  2. kevleitch
    Posted 2 years ago #

    Had a quick look through the plugin code - it seems you are wrapping the shortcode up into the_content() - is that right?

    If its at all possible I'd really like a way to be able to pass in the shop name and section codes dynamically. Is that something that could easily be done do you think?


  3. fsheedy
    Plugin Author

    Posted 2 years ago #

    If it's a page or a post, shortcode will be read automatically by the plugin.

    Why you want to code something more, it will help me find the best way to help you.

  4. kevleitch
    Posted 2 years ago #

    My client is not very knowledgeable so I'd like her to be able to put the Shop name into a text box and enter the numerical value for each section in a custom field. This means she only has to enter her shop name once in one place and it also means she just needs to enter the shop section id number in a custom field rather than have to type out the shortcode into a Page every time.

    It makes much more sense to me to be able to set the two required values dynamically via code than enter them manually each time.

  5. fsheedy
    Plugin Author

    Posted 2 years ago #

    I agree with you, this feature (have a form to generate the shortcode) is planned for version 1.x

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Etsy Shop
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic