bandwidth saving wordpress theme

save you bandwidth by splitting css and javascript files and load them in necessary place only.

for example splitting styles.css into 3

  1. style.css - default in all place
  2. comments.css - css at comments place
  3. more.css - for other thing like archive/pages or whatever

then load them at right place. in your header.php put

<?php if (is_single() && have_post()) : ?>

<link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('template_directory'); ?>/css/comments.css" />

<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/engine/comments.js.php?2"></script>

<?php endif; ?>

i’m use ajax commenting but i required the javascript at single page only. hope this trick can save your bandwidth… sikit-sikit.. haha

6 Comments

  1. Posted May 22, 2007 at 11:44 am | Permalink

    tapi kalau orang hotlink kau nyer file, parah jugak beb. jenuh weh…

  2. Posted May 22, 2007 at 12:47 pm | Permalink

    yer tu satu problem gak, aku cek ramai kanak kanak dok paw flash player aku letak kat fs [bomb3]
    tapi tu bukan dalam konteks entry ni :)

  3. Posted May 22, 2007 at 12:57 pm | Permalink

    Ko tambah lagi ni:
    && ('open' == $post-> comment_status) || ('comment' == $post-> comment_type) )

  4. Posted May 23, 2007 at 2:21 am | Permalink

    orait zeo.. nanti aku tambah [smile]
    tenkiu berimas ! [thumb]

  5. Posted May 24, 2007 at 5:47 pm | Permalink

    aku bru lps unsuspend hosting blk.. hosting aku over resource psl ade forum cina dgn site indon curi link album mp3 dgn tv series aku.. hampess…

    eh.. kluar topik.. haha.. sori2 [thumb]

  6. Posted May 25, 2007 at 12:49 am | Permalink

    tu la len kali jangan letak direct link file-file gitu.. nanti parah