Create WordPress theme with Flash header

March 24th, 2008 | Posted in WordPress | 20 views | 1 Comment
Tags: , , , ,

After 48 hours of sleepless, tutorial marathon, I am finally done with my first WordPress theme. It’s not so much to look at, but like I said it’s my first and I’m proud of it. Learning is quite easy, it’s how to get around the messy codes that almost made me pulled my hair-off. I say, I’m just lucky to see tons of tutorial in the web; really saved a few days of tail chasing. :D

When I got started, I was planning for a dark and loud colored theme with lots of images that depicts various video game characters but then a bit of mind changing and I’ve come up with a clean-minimalist look, few pastel colors + bright gradients to accent the logo and an animated Flash banner. I’m just so glad I finished it, so glad that I would like to share some pointers from what I learned.

To make the theme:

1. Create a template design then slice the necessary image using Photoshop
2. Copy and rename the folder of the Default Theme by Michael Heilemann of Binarybonsai in the themes folder.
3. Modify necessary CSS, PHP pages and images. Since I’m doing basic revision, I only edited 5 files from the default theme:

a. index.php - contains the sidebar, header and footer and the primary page of your website;
b. sidebar.php - this contains functions that shows different components/stats of your blog;
c. footer.php - located at the bottom of the page, contain links.
d. header.php - located at the top of the page. This contains the header image. You can also put the nav buttons here.
e. style.css - where you can control the design and layout of your WordPress.

Remember you must have a mid-level knowledge on how CSS and PHP works and it will also help if you read the tutorials and roam around the wordpress forum for a day or two.

Customizing WordPress header - animated Flash banner:

  1. Open header.php
  2. Locate and remove this code:
    1. <style type="text/css" media="screen"><?php
    2.  
    3. // Checks to see whether it needs a sidebar or not
    4. if(!$withcomments &amp;&amp; !is_single()){
    5. ?>
    6. #page {
    7. background: url("<?php bloginfo(’stylesheet_directory’); ?> /images/kubrickbg-<?php bloginfo(‘text_direction’); ?>.jpg") repeat-y top; border: none;
    8. }
    9.  
    10. <?php } else { // No sidebar ?>
    11. #page { background: url("<?php bloginfo(’stylesheet_directory’); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; }
    12. <?php } ?>
    13. </style>

    This is a part of the kubrick Default Theme that determines the location of the sidebar or if it really needs one. We’ll not use that one, so we can just discard it.

  3. Now locate this code:
    1. <h1><a href="<?php echo get_option(‘home’); ?>/"><?php bloginfo(‘name’); ?></a></h1><div class="description"><?php bloginfo(‘description’); ?></div>

    and replace it with:

    1. <?php
    2.  
    3. if (is_home()){
    4.  
    5. echo
    6. <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    7. codebase = "http://download.macromedia.com/pub/sh … ash/swflash.cab#version=6,0,0,0"
    8. WIDTH="955" HEIGHT="200" id="homePage" ALIGN="">
    9.  
    10. <PARAM NAME=movie
    11. VALUE =
    12. "http://YOURWEBSITE.COM/wp-content/themes/YOURTHEME/flash/index.swf">
    13. <PARAM NAME=quality VALUE=high>
    14. <PARAM NAME=bgcolor VALUE=#FFFFFF>
    15. <EMBED src = "http://YOURWEBSITE.COM/wp-content/themes/YOURTHEME/flash/index.swf"
    16. quality=high bgcolor=#FFFFFF WIDTH="955" HEIGHT="200" NAME="homePage" ALIGN=""
    17. TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflash … r"></EMBED>
    18. </OBJECT>’;
    19. }
    20. ?>

    In this code I named my swf file “index.swf” and placed it on the themes folder under “YOURTHEME/flash/index.swf”. Now this displays the Flash header on the index page only. If you want to show it on all pages, just remove this code:

    1. if (is_home()){}

And that’s it. You now have an animated Flash banner as a header for your WordPress.

2% Loaded…

August 6th, 2007 | Posted in Flash, Nonsense | 9 views | No Comments

My apologies for the current status of this online journal. I haven’t finished yet fixing some parts of this blog.  Meanwhile, you might want to check out my uber humble reel. It shows some of my latest and past works. Just click the Demo Reel link on the sidebar, and let me know any comments or violent reactions. Just drop by always, and you’ll see a great transformation! I promise. :D

Hello world!

August 4th, 2007 | Posted in Game Development, Nonsense | 5 views | 1 Comment
Tags: , ,

Hi there. Hmm.. I wish there’s something more to say, but for now I think i just need to let the world know that this site is alive. Yay! :D I decided to setup this Game Development Journal to fulfill the following:

1) To teach the world things about game development.
2) To track all of my works, for I am one cluttery specie.
3) To serve as my online portfolio(hoping that it would impress someone.. ;-) )

Here are the topics I plan to write, so you wont expect much. :p

  • Game Design and Development
  • Flash Games/ActionScript/Animation
  • 3d Modeling/Rigging/Mapping/Animation
  • Web Design and Development
  • and other Game/Design/Web/Game related stuff (did I said Game twice? :D )

I’m hoping that I could write as many as I want to, but the sad truth is that I might not be able to. Being a corporate slave pays the price of a hectic work, that my break time is the only time that I’m allowed to breath. Plus the fact, that I’m not really a good writer, having wrote this post for 3 hours makes me want to go back to making games and stop writing about it. Stay tuned! Or you’ll miss out the good part! :)