shotcode in a div
-
Hi everybody,
I’m trying to add a shortcode (gtranslate flag) into a div in top left header.I tried some function but anyone work, can you help me please?
MY DIV IS :div class="header__info__items-left"
MY SHORTCODE IS: do_shortcode(‘[gtranslate]’)
/*FUNCTION 1 add_action( 'woo_post_inside_before', 'woo_add_custom' ); function woo_add_custom() { if (is_single()) { echo '<div class="header__info__items-left">'.echo do_shortcode('[gtranslate]').'</div>'; } /*FUNCTION 2 add_action( 'woo_post_inside_before', 'woo_add_custom' ); function woo_add_custom() { if (is_single()) { ?> <div class="header__info__items-left"><?php echo do_shortcode('[gtranslate]'); ?></div> <?php } /*FUNCTION 3 function addflags_div() { if ( is_page() ) { ?> <div class="header__info__items-left"><?php echo do_shortcode('[gtranslate]'); ?></div> <?php } } add_action( 'addflags_top', 'addflags_div' );
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘shotcode in a div’ is closed to new replies.