• I want to have a separate CSS background image for each page on my site and am curious…

    Would it be best to deliver a separate template for each page with different styles, or can I query what page is being asked for and deliver the style based on page? Does either approach make a difference in terms of server resources?

    All the pages have exactly the same structure, just the bg changes.

Viewing 2 replies - 1 through 2 (of 2 total)
  • even if you use a separate stylesheet for every page, you need to query this somewhere, probably also in header.php.
    i personally would embed the query for the styles for the page backgrounds in the head section of header.php. (that is not based on any detailed research on server resources)

    http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page

    Thread Starter mozity

    (@mozity)

    That looks very much like what I was thinking, then I could deliver a different css tag, or different sheet, or anything else I suppose based on which page is being called.

    Thanks very much for the reference. Never created a function before, but it sure looks like it could be very powerful and a good think to learn.

    I am really starting to have fun with WP! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple templates vs page query to deliver CSS’ is closed to new replies.