Support » Themes and Templates » WordPress Templates and Sidebars not working

  • 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 15 replies - 1 through 15 (of 23 total)
  • esmi

    (@esmi)

    Forum Moderator

    I am trying to use a custom template (t-blog.php) to design the page.

    What page?

    beta.cleantelligent.com/blog

    esmi

    (@esmi)

    Forum Moderator

    A static front page or your site’s main posts page?.

    the main posts page. the static site is the home page. I’m trying to design the blog based on a custom template. It is set up in the settings as my posts page.

    esmi

    (@esmi)

    Forum Moderator

    The main posts page on any WP site will always use the index.php template file automatically – irrespective of any page template that you try to apply via the back end. So you need to work on that template file – not a custom one.

    I’m sorry, I am a little bit confused. Isn’t the index.php used by the main static page, then the page.php is used by the posts page? That’s how I always thought it was. Am I backward?

    And wouldn’t it override anyway if I change the template in the Page Attributes options?
    All of my other pages are organized into categories and I’ve assigned them a template and sidebar using the page attributes. (See the Tour items in the main nav. They’re all atyled the same way.)
    Wouldn’t I do the same with my blog? I’d like to use the same template on the blog as well as some secondary blog related pages, such as webinars, etc.

    esmi

    (@esmi)

    Forum Moderator

    And wouldn’t it override anyway if I change the template in the Page Attributes options?

    Nope. By design, the main posts page always uses the index.php template file. Any custom template in the Page template dropdown is simply ignored. Is there any reason why you can’t edit index.php instead?

    Sure I can, but I just don’t understand what you mean… If it always uses index.php, then what’s the point of the custom templates? Or is that only for static pages?

    esmi

    (@esmi)

    Forum Moderator

    Or is that only for static pages?

    Pretty much, yes. The main posts page is a special case.

    Well okay then. That was never made clear before. Thanks Esmi. You’ve always seemed to be a huge help on this forum. I always hope it will be you who answers my questions. 🙂

    So, is that the “default template”?

    I answered that myself. It seems to be working now. Thanks a load!

    esmi

    (@esmi)

    Forum Moderator

    No problem. You might want to bookmark the Template_Hierarchy page to try and avoid this kind of frustration in future. 🙂

    Esmi,

    If you’re still around for answers, I have a related question. So, the blog is recognizing my posts now, but the sidebar is gone, as well as the option in page attributes for the sidebar.

    I have <?php get_sidebar(); ?> in my index.php, but the option isn’t there in the blog edit page… How do I load one of my WP sidebar widgets onto this blog page?

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘WordPress Templates and Sidebars not working’ is closed to new replies.