• Resolved JCKnoell

    (@jcknoell)


    I have started over on designing my website’s blog.
    beta.cleantelligent.com/blog
    I am trying to use a custom template (t-blog.php) to design the page. It will also need a custom sidebar in order to list archives, etc.
    This is different from my main website.

    I can’t seem to get the blog template, or the blog sidebar to work. Nor is it displaying my posts. I have changed the settings in Reading so that “Blog” is my posts page.

    Any idea why it’s not working at all? (The title of the page seems to be calling my most recent posts title, but the blog post itself is not there.)

Viewing 8 replies - 16 through 23 (of 23 total)
  • Is this in your theme’s index.php template file?

    Thread Starter JCKnoell

    (@jcknoell)

    yes.

    Did you create this theme or was it downloaded from somewhere?

    Thread Starter JCKnoell

    (@jcknoell)

    The theme was created by a third-party web design company, (which company is among the worst I’ve ever dealt with) and I was called in to fix their mistakes…

    You have my sympathy…

    Have you tried turning debug on and enabling error logging to see if that helps?

    Thread Starter JCKnoell

    (@jcknoell)

    hmm… even after reading those articles, I probably wouldn’t know what you’re talking about… ??

    Thread Starter JCKnoell

    (@jcknoell)

    Maybe this will help. This is the code for sidebar-web.php. I think it’s broken, but I don’t know exactly what I’m looking at, as php is not my thing:

    <?php
    /**
     * The Sidebar containing the main widget area.
     *
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
     */
    
    $options = twentyeleven_get_theme_options();
    $current_layout = $options['theme_layout'];
    $nav = sb_get_page_nav($post);
    if ( 'content' != $current_layout ) :
    ?>
    <img class="sidebar-top" src='<?php bloginfo('stylesheet_directory'); ?>/images/sidebar-top.png' />
    		<div id="secondary" class="widget-area" role="complementary">
    		<?php
    			$post_obj = $wp_query->get_queried_object();
    			$post_name = $post_obj->post_name;
    			$title = 'cs-' . $post_name;
    			?>
    		<?php
    			if($post_name == 'blog'){
    				if ( ! dynamic_sidebar( 'sidebar-web' ) ) :
    				endif;
    			}
    		?>
    
    			<div class="SimpleSideNav">
    				<?php wp_nav_menu(array('container_id' => 'left-navigation','menu' => 'Support')); ?>
    			</div>
    
    		<?php if ( ! dynamic_sidebar( 'sidebar-all' ) ) : ?>
    		<?php endif; // end sidebar widget area ?>
    		<?php /*
    		<nav id="left-nav">
    			<div class="nav-wrapper">
    				<?php if(!$nav['no_nav']) {
    					wp_nav_menu(array('container_id' => 'left-navigation','menu' => $nav['title']));
    				} ?>
    			</div>
    		</nav>
    			*/ ?>
    
    			<?php if ( ! dynamic_sidebar( $title ) ) : ?>
    			<?php endif; // end sidebar widget area ?>
    			<img class="sidebar-bot" src='<?php bloginfo('stylesheet_directory'); ?>/images/sidebar-bot.png' />
    		</div><!-- #secondary .widget-area -->
    
    <?php endif;
    $parent_title = get_the_title($post->post_parent);
    if($parent_title == 'Tour'){
    	echo"
    	<script>
    	jQuery('.w-1').hide();
    	</script>
    	";
    }
    
    ?>

    Thread Starter JCKnoell

    (@jcknoell)

    AGH! Okay, so I finally got the blog sidebar working. beta.cleantelligent.com/blog
    However, for the single posts, if you click on one blog post, the sidebar is missing still.
    If I remember correctly, this should be single.php, right?

    Here’s my code from that template… Any thoughts on why the sidebar isn’t showing up on just the single posts?

    <?php
    /**
     * The Template for displaying all single posts.
     *
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
     */
    
     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>
    <?php get_footer(); ?>
Viewing 8 replies - 16 through 23 (of 23 total)
  • The topic ‘WordPress Templates and Sidebars not working’ is closed to new replies.