WordPress.org

Ready to get started?Download WordPress

Forums

Can't Update Blog Template (2 posts)

  1. jaymeblackmon
    Member
    Posted 1 year ago #

    I created a page called "blog" with a template assigned to it called "blog" using the file blog.php. I also set the blog to be displayed statically under "Settings -> Reading" by choosing the page name "blog".

    The blog works fine, however when I created the template I didn't use any of the meta information in the template. Now, the owner of the blog wants to add meta info into the template. When I edit blog.php, none of the changes are reflected when I refresh.

    There are no caching plugins. All of the other page templates will update fine.

    Any ideas?

  2. James Kirk
    Member
    Posted 1 year ago #

    Hey jaymeblackmon,

    Yeah, this one bites! Here's the background to your challenge (and I'll follow up with one solution I've used for clients in the past!)

    You've probably already read "Creating a Static Front Page", but if not, check that one out. The challenge with using the built in "static front page and Posts page" is that WordPress will use the index.php or home.php page template from your theme to generate the actual /blog.php page :(

    As indicated by this statement on that page:
    Do not use a custom Page template for this page! home.php or index.php will be used to generate this page.

    The work around, since you have created a template page (blog.php) you can use that, but you should not choose it as the page to display your posts (under the "Settings -> Reading" page in the admin area). Instead just leave that setting on "-- Select --".

    Next you will have to make sure anywhere you have links on the site (likely the navigation in header and footer) are linking to the page's correct URL (again, guessing that is /blog.php?) Then the template you created should work just fine to display your site's blog posts.

    Anyway, this has worked for me when I had clients wanting a custom /blog page template set up that was slightly different than other pages in their theme.

    Let us know how it goes!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.