0
votes

I am working on theme which self designed by some one. Theme have right sidebar by default.

I made a new template for a Video Page page-videos.php and call 2 sidebars (left and right) there.

Video page showing the excerpts for the Video Posts. The template file of video Posts is tpl-video.php

Video Page call the template of Video Posts like: while ( have_posts() ) : the_post(); { get_template_part('tpl-video');

Video Post template not calling the sidebars, only content coding there, starting of template: <?php if( is_single() ) { ?> ending of template: <?php } ?>

Now i want to call same layout or sidebars Video Post template, that i made for Video Page.

But result is the mix up of default and Video Page template means 3 sidebars there, 2 right and 1 left.

When I made the 'tpl-video.php' template as default template 'page.php' then it changes the settings on Video Page, may be due to this line in page-videos.php: while ( have_posts() ) : the_post(); { get_template_part('tpl-video');

Kindly any one guide me to the solution which add left sidebar in Video Posts Page via tpl-video.php without disturbing any thing else.

3
what is the question?bofredo

3 Answers

0
votes

A hard one to answer without looking at the actual code of the theme. But by going what you say "Theme have right sidebar by default." and later you say "and call 2 sidebars (left and right) there." and then indicate it has 3 sidebars which is the default right one and both the left and the right you added it looks like the default sidebar is getting in your way.

Have a look where the default sidebar is called and make that an if statement depending on your template call

Or if you only want 1 right sidebar you should not add it to the video template and only add the left one as the right one is there by default

HtH Edwin

0
votes

I'm not sure if I am understanding your question correctly, but if you need to add a sidebar to a particular template, you can first check to see if the sidebar is active, then load it in any template you want. If for single posts, you might do something like:

if( is_single() ) {    
    if ( is_active_sidebar( 'SIDEBAR_ID' ) )
         dynamic_sidebar( 'SIDEBAR_ID' );
}

If I am not understanding your question, let me know.

0
votes

kindly visit the testing page and check the posts on it. fruityim.com/testing/videos

This is the main Video Page and the links there are Video Post which have different template. A like to apply the page template on post without effecting the looks of the Page.