• Resolved AthanTheGreat

    (@athanthegreat)


    Hi,

    I pasted a number of shortocodes inside a post like this;

    *the class video_player_content is just a custom css layout class”

    <div class=”video_player_content”> [hdvideo id=19] </div>
    <div class=”video_player_content”> [hdvideo id=18] </div>
    <div class=”video_player_content”> [hdvideo id=20] </div>
    <div class=”video_player_content”> [hdvideo id=21] </div>

    and then used the_content( ) to display the contents/videos. But only the first shortcode is displayed or wrapped by the div below. This is how I display the contents;

    <div style=” width:100%” id=”gallery_slider_<?php echo $i; ?>” class=”gallery_slider hidden”>
    <?php the_content(); $i++;?>
    </div>

    the DOM looks like this;
    > <div style=” width:100%” id=”gallery_slider_<?php echo $i; ?>” class=”gallery_slider hidden”>
    <div class=”video_player_content”>..</div>
    </div>
    > <div class=”video_player_content”>..</div>
    > <div class=”video_player_content”>..</div>
    > <div class=”video_player_content”>..</div>

    what i need to do is place all the videos inside this div:
    > <div style=” width:100%” id=”gallery_slider_<?php echo $i; ?>” class=”gallery_slider hidden”>
    <div class=”video_player_content”>..</div>
    <div class=”video_player_content”>..</div>
    <div class=”video_player_content”>..</div>
    <div class=”video_player_content”>..</div>
    </div>

    but apparently, i guess the plugin has its own way which i cant explain how or why.. please help.

    https://www.ads-software.com/plugins/contus-video-gallery/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    Yes the plugin has its own way to display the player based on the shortcodes. If you want to use shortcode, then paste in page/post in admin panel. Go to admin -> Page/post -> add new -> select “Text” tab in the editor. Now paste your div tags for eg:

    <div class="video_player_content">[hdvideo id="1"]</div>
    <div class="video_player_content">[hdvideo id="2"]</div>
    <div class="video_player_content">[hdvideo id="3"]</div>

    The plugin will read the shortcode only if you paste in page/post and not in file. Can you please let me know why you are trying to use shortcode in file? Are you are trying to get banner like the following one https://screencast.com/t/H522bXNB3av ?

    Thread Starter AthanTheGreat

    (@athanthegreat)

    this is the content of the post

    <div class="video_player_content">[hdvideo id="1"]</div>
    <div class="video_player_content">[hdvideo id="2"]</div>
    <div class="video_player_content">[hdvideo id="3"]</div>

    and my code in php file is this

    <div style=" width:100%" id="gallery_slider_<?php echo $i; ?>" class="gallery_slider hidden">
                        <?php the_content();
    					 $i++;?>
                    </div>

    what im expecting to get when i run the php/html is

    <div style=" width:100%" id="gallery_slider_<?php echo $i; ?>" class="gallery_slider hidden">
                       <div class="video_player_content">[hdvideo id="1"]</div>
                       <div class="video_player_content">[hdvideo id="2"]</div>
                       <div class="video_player_content">[hdvideo id="3"]</div>
    </div>

    but what happens is that it only the first shortcode is wrapped by the div, this is how it looks in the dom

    <div style=" width:100%" id="gallery_slider_<?php echo $i; ?>" class="gallery_slider hidden">
                       <div class="video_player_content">[hdvideo id="1"]</div>
    </div>
                       <div class="video_player_content">[hdvideo id="2"]</div>
                       <div class="video_player_content">[hdvideo id="3"]</div>

    the 2nd and 3rd videos are out of the wrapping div. how can i solve this.

    Thread Starter AthanTheGreat

    (@athanthegreat)

    how can i display multiple videos using 1 shortcode, because apparently, the category shortcode only displays the video thumbnails but not the video istelf

    Hi,

    Open \wp-content\plugins\contus-video-gallery\front\views\videoshortcode.php and find // Enable/disable Related videos starts here. Before the code, find the below code.

    $output .= '</div></div>';
    }
    $output .= '</div></div>';

    and replace with the following code.

    $output .= '</div>';
    }
    $output .= '</div></div>';

    Please refer https://screencast.com/t/nQR2TVdQYFC4. Now find $output .= '<div class="video-cat-thumb">'; and cut the code and place before // show rss icon enable / disable. Refer https://screencast.com/t/4wYTaxKCT.

    If you have any other queries feel free to contact us.

    Thread Starter AthanTheGreat

    (@athanthegreat)

    Wow, that fixed the problem ?? thank you so much :))))

    Glad to hear you have fixed the issue.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Only one shortcode [hdvideo] is read by the_content( )??’ is closed to new replies.