I want to display sidebar only in the homepage of my wordpress site and I wanted to disable sidebar in all the inner pages/posts/links. Please advise me how to achieve this factor. Thanks a lot.
There is this this line of code which loads sidebar.php: <?php get_sidebar(); ?> PHP: If you delete it from your files page.php and single.php there should not be any sidebar displayed when viewing pages or posts.
@Imposter has given you the right solution. Delete the <?php get_sidebar(); ?> PHP: from single.php (displays posts) and page.php (displays pages) template files in your WordPress theme folder. Alternatively, edit the sidebar.php file. You need to wrap the entire content of the sidebar.php in a conditional tag. <?php if ( is_home() || is_front_page() ) { ?> YOUR ENTIRE CONTENT <?php } ?> PHP: