Grow your CSS skills. Land your dream job.

WordPress theme Logo only on certain pages?

  • Anonymous
    # March 2, 2013 at 12:58 am

    I’m working on a new wordpress theme and the logo is only appearing on the many posts page, not on single posts or pages. Anyone seen this before? How do I fix it?

    Many Posts: http://sometimesyoubreakaclarinet.com/
    Single Post: http://sometimesyoubreakaclarinet.com/test/
    Page: http://sometimesyoubreakaclarinet.com/project-101/

    I’ve worked around this problem by posting the long link to the image, rather than trying to link to it within the directory.

    # March 2, 2013 at 6:25 am

    It’s happening because the `header.php` file (where you probably have your logo markup) gets included on every page so the base URL for relitive links changes. A way to get around this – always make sure the path is based wherever the theme directory is in relation to the page – is to use `< ?php bloginfo('template_url') ?>` in front of all your asset paths. Then, the same links are generated (the correct ones) for every page.

    Viewing 2 posts - 1 through 2 (of 2 total)

    You must be logged in to reply to this topic.

Projects

Colophon

CSS-Tricks* is created, written by, and maintained by Chris Coyier. It is built on WordPress, hosted by MediaTemple, and the assets are served by MaxCDN. The fonts are Source Sans and Source Code Pro. It is made possible by viewers like you who subscribe to The Lodge and through advertising for products and services I like.

*May or may not contain any actual "CSS" or "Tricks".