• So, my sidebar is working just fine on my blog page: beta.cleantelligent.com/blog
    However, when you click a single post, I’d like that same sidebar to show up.

    I am assuming this would be under single.php, right? That code is listed below. Let me know if you need any other code and I’ll post it here.

    I have the ‘blog’ sidebar in my page attributes on the Edit Page in WordPress, but it’s just not being recognized by the template, I guess?

    Any help would be great. Thanks!

    <?php
    get_header(); ?>
    <div class=”blackbar”>
    <div class=’bbw’>
    Blog
    </div>
    </div>
    <div class=’cont-wrap’>

    <div id=”primary”>
    <?php
    $post_obj = $wp_query->get_queried_object();
    $post_name = $post_obj->post_name;
    if($post_name == ‘blog’){
    echo ‘Blog’;
    }else{
    $parent_title = get_the_title($post->post_parent);
    echo $parent_title;
    }
    ?>
    <div id=”content” role=”main”>

    <?php while ( have_posts() ) : the_post(); ?>

    <?php get_template_part( ‘content’, ‘archive’ ); ?>

    <?php endwhile; // end of the loop. ?>

    </div><!– #content –>
    </div><!– #primary –>
    <?php get_sidebar(); ?>
    </div>

Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter JCKnoell

    (@jcknoell)

    Okay, I’m finding a big discrepancy and I’m totally confused now.
    In my Tour pages (http://beta.cleantelligent.com/tour/janitorial-inspection-software for example) The template does NOT call the sidebar, nor so I have one listed in my page attributes. And yet, there it is, exactly how I want it. Where is that coming from? I cannot find that sidebar anywhere, but it’s on my page.

    The benefits pages (http://beta.cleantelligent.com/benefits/new-business-win-cleaning-bids for example) and the about pages, etc are all using a custom menu right now for the sidebar, and their templates all call the sidebar.

    Where is the tour sidebar coming from? Any ideas?

    Here’s the code for my tour template:

    <?php
    /**
     * Template Name: Tour
     */
    
    get_header(); ?>
    <div class="blackbar">
    <!--SOCIAL LINKS-->
    <style>
    .socialicons{ padding: 2px;}
    </style>
    <div style="top: 15px; position: absolute; left: 50%; margin-left: 353px; white-space: nowrap;">
    <a href="https://www.youtube.com/CTsoftware" target="_blank" ><img class="socialicons" height="22" width="22" src="/wp-content/uploads/2013/11/YouTubePlay.png" /></a><a href="http://www.linkedin.com/company/cleantelligent_software" target="_blank" ><img class="socialicons" height="22" width="22" src="/wp-content/uploads/2013/11/linkedin.png" /></a><a href="https://twitter.com/#!/CleanTelligent1" target="_blank" ><img class="socialicons" height="22" width="22" src="/wp-content/uploads/2013/11/twitter.png" /></a><a href="http://www.facebook.com/CleanTelligent" target="_blank" ><img class="socialicons" height="22" width="22" src="/wp-content/themes/cleantelligent/images/facebook.png" /></a><a href="https://plus.google.com/102775665167203456874" rel="publisher"><img src="/wp-content/uploads/2013/11/GooglePlusIcon.png" alt="Google +" style="padding: 0 0 1px 2px;"/></a>
    </div>
    <div style="font-family: 'News Cycle', sans-serif; color:#D1D1D1;  position: absolute; left: 50%; margin-left: 345px; white-space: nowrap; font-size: 40%;">
    <img style="position: relative; top: 8px;" src="/wp-content/uploads/2013/11/phonetrans.png" />(801) 404-5038</div>
    
    <!--END OF SOCIAL LINKS-->
    <div class='bbw'>
    <?php
    	$parent_title = get_the_title($post->post_parent);
    	echo $parent_title;
    ?>
    </div>
    </div>
    <div class='cont-wrap'>
    		<div id="primary">
    			<div id="content" role="main">
    				<?php while ( have_posts() ) : the_post(); ?>
    
    					<?php get_template_part( 'content', 'pricing' ); ?>
    
    				<?php endwhile; // end of the loop. ?>
    
    			</div><!-- #content -->
    		</div><!-- #primary -->
    </div>
    
    <?php get_footer(); ?>
    Thread Starter JCKnoell

    (@jcknoell)

    This is the pricing template. It seems very simliar.

    <?php
    /**
     * Template Name: Plans and Pricing
     */
    
    get_header(); ?>
    <div class="blackbar">
    <div class='bbw'>
    <?php
    	$parent_title = get_the_title($post->post_parent);
    	echo $parent_title;
    ?>
    </div>
    </div>
    <div class='cont-wrap' style="width: 1135px;">
    		<div id="primary">
    			<div id="content" role="main">
    
    				<?php while ( have_posts() ) : the_post(); ?>
    
    					<?php get_template_part( 'content', 'pricing' ); ?>
    
    				<?php endwhile; // end of the loop. ?>
    
    			</div><!-- #content -->
    		</div><!-- #primary -->
    </div>
    
    <?php get_footer(); ?>
Viewing 3 replies - 16 through 18 (of 18 total)

The topic ‘Sidebar on single.php’ is closed to new replies.