Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Dan-Thomas Tveita
Dan-Thomas Tveita
107 Points

_s: Site-title changes only showing on index.html, not page.php or single.php

Ive changed my site-title to show a logo-image instead of text like this:

<h1 class="site-title">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
<img src="/wp-content/uploads/2015/07/mylogo.png" alt="Logo" /></a>
</h1>

Its working perfectly on index.php. But when i move to another page (single.php or page.php) the logo reverts back to the site-title text. All other changes (css styling etc) are still intact, and changing the css on the site-title class works like it should on all pages.

So its only the code above that is "reverting" when visiting any other page than index.html.

Browser cache has been cleared. Tried different browsers.

Using Underscores btw.

Dan-Thomas Tveita
Dan-Thomas Tveita
107 Points

Just to be clear;

get_header(); ?> is in my page.php and single.php where they are supposed to be.

On ie. mydomain.local/blog (not index.php), "inspect element" on my site title is showing the old code (bloginfo), not the new img code - as if it hasnt been updated.

2 Answers

Dan-Thomas Tveita
Dan-Thomas Tveita
107 Points

Im on Nginx.

But i figured it out. Rather embarrasing, but it had nothing to do with cache - and everything to do with markup :)

Thanks though!

Sean T. Unwin
Sean T. Unwin
28,690 Points

Glad you have it worked out. :)

Sean T. Unwin
Sean T. Unwin
28,690 Points

This is a local Apache server I presume?

Are you using a caching plugin and is it enabled?

Clear you browser cache.

If you are you using Apache and are using the mod_expires module via .htaccess, then you could set the ExpiresDefault A0 or ExpiresDefault "now".

You could also put, in your config.php at the end before the closing PHP tag, define('DISABLE_CACHE', true);.