Single template

Posted in: Newsmag
Post count: 117

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 –>

Post count: 6600

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

Post count: 117

Hi Lucian,
Thanks for the suggestion. However, I want to setup a course which I don’t want to show the social sharing, next/previous articles, related article.
How can I remove those sections in custom template.

thanks
st

Post count: 7909

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!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newsmag’ is closed to new topics and replies.