Support » Fixing WordPress » Include extra files on Custom Page Template

  • Hello,

    I have a site that uses two different page templates. I want to include an extra stylesheet in the special template but I don’t know how to do that with just one header.php file.

    I would imagine there would be some sort of hook for me to use. Something like is_page_template(“”) which would determine if the page is using a certain template and then use php and conditional statements to include an extra file.

    Any suggestions?

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi


    Forum Moderator

    Why add an extra stylesheet? Why not just add page-specific style to the main stylesheet?

    in the header.php you can include all the stylesheets that you like. just copy the link twice and change the path to the new css file.



    Forum Moderator

    why are you not searching the codex if your idea of a conditional tag exists?

    @esmi I could add page specific styles but I like to break a large style sheet into several smaller ones for readability and making the page lighter. In this case I have a totally different layout so there is no need to download an extra couple hundred lines when you don’t have to. For small page to page changes I tend to have one style sheet that holds all of those.

    @pidi233 That was my fall back plan. 🙂 . I figured that I should put a little effort into making the page as light as possible.

    @aslchymth Thank you! I knew it must be there. It is exactly what I need. I did search the codex but I must be bad with keywords as I was unable to find it. Thanks for the help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Include extra files on Custom Page Template’ is closed to new replies.