The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

WP UI - Tabs, Accordions, Sliders
WP UI shortcode with custom fields (6 posts)

  1. Stefan
    Posted 3 years ago #

    I'm trying to get the WP UI tabs to work with custom fields but I can't get the following code to work. Is it possible to use shortcodes with custom fields?

    <?php echo do_shortcode('[wptabs style="wpui-android"]'); ?>
    $values = get_post_meta($post->ID, 'delivery_information', true);
    if ($values){
    echo do_shortcode('[wptabtitle]');
    echo 'Delivery Info';
    echo do_shortcode('[/wptabtitle]');
    echo do_shortcode('[wptabcontent]');
    echo $values;
    echo do_shortcode('[/wptabcontent]');
    <?php echo do_shortcode('[/wptabs]'); ?>


  2. avipr
    Posted 3 years ago #


    I also want to know , if here is any way to get it working without shortcode, I am doing it in single.php, but not able to get. Can any body please help.

  3. akridgeblue
    Posted 3 years ago #

    Hmm. Not sure exactly what you are trying to do there but here are some tips.
    // With opening and closing shortcode use this method instead.

    echo do_shortcode('[iscorrect]'.$text_to_be_wrapped_in_shortcode.'[/iscorrect]');

    Using shortcode in custom field example:

    < ?php
    if (get_post_meta($post->ID, 'gallery', true)) {
    $shortcode = get_post_meta($post->ID, 'gallery', true);
    echo do_shortcode("$shortcode");
    } else { echo ''; }

  4. avipr
    Posted 3 years ago #

    thanks @akridgeblue
    I don't know if @Stefan83 got his answer, but I can explain what I need-
    I have custom fields with every post and i want to show them using tabs, suppose i have 4 extra fields with posts- say field 1, field2, field3 and field 4, now i want to show the data of these fields using tabs. because this data is related to post so I want to code in single.php

    Let me try if I can get into.

    Thanks again

  5. akridgeblue
    Posted 3 years ago #

    No problem. Yeah coding with shortcodes and php can be a pain. Its so finicky sometimes and takes me a lot of debugging/testing.
    Check this out for some more info:
    and this:
    and this for custom shortcodes(might try adding shortcode stuff and content into this then just call one shortcode but not sure if that would work:

  6. akridgeblue
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP UI - Tabs, Accordions, Sliders
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic