How to add a WordPress template opening and closing shortcode?

recently i install wordpress Themeforest VideoTube Theme. But when i use codecanyon Social Locker plugin, then facing this issue. My wordpress theme only support do_shortcode

My short code is…

Read More
[sociallocker id="2378"]    [/sociallocker]

and i want to put this code in the middle position of my short code.

<div class="player player-small <?php print apply_filters( 'aspect_ratio' , 'embed-responsive embed-responsive-16by9');?>">

Kindly help me… how can i to do this? What query i set to in my wordpress theme functions.php file?

Related posts

2 comments

  1. You can use do_shortcode like this way,

    $text_to_be_wrapped_in_shortcode = '<div class="player player-small <?php print apply_filters( 'aspect_ratio' , 'embed-responsive embed-responsive-16by9');?>">';
    
    echo do_shortcode( '[sociallocker id="2378"]' . $text_to_be_wrapped_in_shortcode . '[/sociallocker]' );
    
  2. This should work,

    $text_to_be_wrapped = "<div class='player player-small ".apply_filters( 'aspect_ratio' , 'embed-responsive embed-responsive-16by9')."'";
    
    echo do_shortcode( '[sociallocker id="2378"]' . $text_to_be_wrapped . '[/sociallocker]' );
    

Comments are closed.