Hi,
I want to make a template for single post with custom sidebar name “Course”.
How can I modified the single.php so that there is no option of the sidebar and just display sidebar name “Course”?
thanks
st
======
<div class=”td-container td-post-template-default”>
<div class=”td-container-border”>
<div class=”td-pb-row”>
<?php
//the default template
switch ($loop_sidebar_position) {
default: //sidebar right
?>
<div class=”td-pb-span8 td-main-content” role=”main” itemprop=”mainContentOfPage” itemscope=”itemscope” itemtype=”<?php echo td_global::$http_or_https?>://schema.org/Blog”>
<div class=”td-ss-main-content”>
<?php
locate_template(‘loop-single.php’, true);
comments_template(”, true);
?>
</div>
</div>
<div class=”td-pb-span4 td-main-sidebar” role=”complementary” itemscope=”itemscope” itemtype=”<?php echo td_global::$http_or_https?>://schema.org/WPSideBar”>
<div class=”td-ss-main-sidebar”>
<?php get_sidebar(); ?>
</div>
</div>
<?php
break;
case ‘sidebar_left’:
?>
<div class=”td-pb-span4 td-main-sidebar” role=”complementary” itemscope=”itemscope” itemtype=”<?php echo td_global::$http_or_https?>://schema.org/WPSideBar”>
<div class=”td-ss-main-sidebar”>
<?php get_sidebar(); ?>
</div>
</div>
<div class=”td-pb-span8 td-main-content” role=”main” itemprop=”mainContentOfPage” itemscope=”itemscope” itemtype=”<?php echo td_global::$http_or_https?>://schema.org/Blog”>
<div class=”td-ss-main-content”>
<?php
locate_template(‘loop-single.php’, true);
comments_template(”, true);
?>
</div>
</div>
<?php
break;
case ‘no_sidebar’:
//td_global::$load_featured_img_from_template = ‘art-slide-big’;
td_global::$load_featured_img_from_template = ‘full’;
?>
<div class=”td-pb-span12 td-main-content” role=”main” itemprop=”mainContentOfPage” itemscope=”itemscope” itemtype=”<?php echo td_global::$http_or_https?>://schema.org/Blog”>
<div class=”td-ss-main-content”>
<?php
locate_template(‘loop-single.php’, true);
comments_template(”, true);
?>
</div>
</div>
<?php
break;
}
?>
</div> <!– /.td-pb-row –>
</div>
</div> <!– /.td-container –>
Hi,
You don’t need to alter the post template code for this. You can create your custom sidebar then set it to appear on each post from here: http://screencast.com/t/3fniN0rr0cB
Thanks
Hi,
I understand that you want a custom template, so if you do that and you customize the default template single.php you can find social sharing, next/previous, related articles in loop-single.php: http://screencast.com/t/EavkeaFJ
Thanks!
-
This reply was modified 11 years by
Alin [tagDiv].