Member Offer
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Head tags 'n' stuff

Discussion in 'Website Coding & Programming Forum:' started by Paul Murray, Aug 22, 2011.

  1. Paul Murray

    Paul Murray Moderator Staff Member

    Currently I'm working on a page template for my blog that will act as the landing page and will feature a JQuery slideshow. Since I'm using Wordpress, I have left the get_header() call in the template as it includes my navigation and such like.

    What's the best way of linking to scripts and the CSS for this one page? Should they ideally be added to the head tag? I don't see the point in linking to content that will only be used on one page.
  2. Corrosive

    Corrosive Moderator Staff Member

    I believe you can make a stand-alone template that acts as a home page only. Then you could link the script into that rather than including it in the header file.
  3. Paul Murray

    Paul Murray Moderator Staff Member

    A stand-alone template as in a separate index page, or a template that's used through Wordpress (which is the method I'm employing now).

    Do the links absolutely have to be included inside the head tags or can I just link to them outside the tags on that particular page? What would happen if I added extra head tags just to the template file?
  4. Corrosive

    Corrosive Moderator Staff Member

    Javascript doesn't have to go in the head tags. In fact many people recommend they go before the closing body tag because it makes pages load faster. Just watch out if it uses document.write to insert part of the page's content as you may then have trouble.

    CSS links should go before the closing head tag.

    You shouldn't add extra head tags either. That just doesn't make any sense.
  5. Paul Murray

    Paul Murray Moderator Staff Member

    Thanks, that's just what I needed to know.
  6. Corrosive

    Corrosive Moderator Staff Member

    You are welcome.

    One day I'm gonna wean you lot off Wordpress. The template logic is just fundamentally flawed in my opinion :icon_biggrin:
  7. Paul Murray

    Paul Murray Moderator Staff Member

    I really hate web design though. I enjoy the coding side and the final outcome but the hassle of making everything compatible across multiple platforms and browsers just fills me with dread. Then there's ensuring everything loads quickly (and correctly), and let's not forget SEO.

    If I could make do without a blog I'd happily forget Wordpress and pay for a unique, custom design.
  8. Corrosive

    Corrosive Moderator Staff Member

    Fair comments. The CMS we use is very flexible indeed and no diving into the guts of the CMS to make things work. You basically port in a plain HTML/CSS based design, split it into chunks for easy updating and then apply your templates to the content. ModX >> Content Management System, Framework, Platform and More | MODX my saviour in web design!

    Cross-browser is a bitch though and no CMS will stop you having to do that. Getting it right is a balance between knowing the pitfalls from experience and accepting that there will always be subtle differences and working out what you can and can't live with.

    All good fun huh?
  9. Edge

    Edge Active Member

    Ditto that - we just had to make a complex online aplication render perfectly in IE6 for a council. We were using IE tester at first which we've had good mileage from in the past but it doesn't always play ball and render like a standalone ie6 so in the end we set up virtual machines with xp and ie6 on them. :icon_Wall: Just felt so painful and pointless.

Share This Page