• Resolved knayte

    (@knayte)


    I have created several websites using WordPress, but I’ve come across a problem that has me baffled. A website I am creating has 6 or 7 pages including a blog page. I have a template created for the blog page that is different from the rest of the pages. For God knows what reason, I cannot get my custom template to be applied to the blog page. It shows up in the Templates drop down menu when I’m editing the page, but on the live page it does not get applied. I’ve checked everything. This is what I have in the php file for the template:

    <?php
    /*
    Template Name: Blog Template
    */
    ?>

    No matter what I put in this file, it reverts to the default template. The template is essentially the same as the rest of the site but with a different sidebar. That couldn’t cause the problem, could it? Is there something obvious I’m missing? Anyone else had this problem? I’ve never come across it before.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Have you checked if another template exists for this page, like pagename.php, page-slug.php or page-id.php (change pagename, slug and id accordingly)?

    Since I actually have no idea where the page template is in the hierarchy, this could be the problem.

    Peter

    Is this site using a static front page with the Blog page as it’s posts’ page? If so, you should be editing index.php – not a custom page template.

    Thread Starter knayte

    (@knayte)

    Yes, static front page with a separate blog page for the posts. So if every page on the site is using the default template except for the blog page, do I essentially have to create a custom template to apply to all the pages, and use index.php for the blog page? I can’t create a template for the blog page?

    All of the Pages on your site use the page.php template. Your Posts page (whether it’s your site’s front page or another specified page) uses index.php. So you only have to edit index.php in your theme.

    Thread Starter knayte

    (@knayte)

    Awesome, thanks so much for the quick response. I feel like an idiot for not catching that earlier. Case closed!

    Oh, the index.php page. Yes, that worked! Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Page Template not being applied’ is closed to new replies.