Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

do_shortcode [tabs]

Home / Forums / Virtue Theme / do_shortcode [tabs]

This topic is: Resolved
[Resolved]
Posted in: Virtue Theme
October 31, 2017 at 4:37 pm

Hi Ben,

I’m trying to programmaticaly make tabs with dynamic content in a widget, however it seems complicated. I need to put other shortcodes and php inside a shortcode, is this even possible?

function booking_shortcode() {
ob_start();

echo '<div class="bookwith">';
echo (do_shortcode('[tabs]'));

//tab always showing
echo (do_shortcode('[tab][contact-form-7 id="6859" title="BRONBEZBOOK"][/tab]'));

//tab showing if not null
if ($hotelid != null) {
echo (do_shortcode('[tab title="Booking.com" start=open]'));
echo '<a target="_blank" class="bookitafter" href=" . $bcity . '&highlighted_hotels=' . $hotelid . '">Бронировать</a>';
echo (do_shortcode('[/tab]'));
}
echo (do_shortcode('[/tabs]'));
echo '</div>';
return ob_get_clean();
}
add_shortcode('booking_sc', 'booking_shortcode');

Can i try to make it this way:
$variable = echo '<a target="_blank" class="bookitafter" href=" . $bcity . '&highlighted_hotels=' . $hotelid . '">Бронировать</a>';

echo (do_shortcode('[tab title="Booking.com" start=open]' . $variable .'[/tab]'));

  • The forum ‘Virtue Theme’ is closed to new topics and replies.