« »
Comic

Tips For Customizing

Wednesday, November 16th, 2005

Here I’ll be slowly adding some tips on editing the files to customize this theme to your own design or needs.

Wide-Load Comics

This template is set to fit on an 800×600 screen. However some of you may have wide comics and want to optimize for 1024×768. If your comic is wider than 760 pixels then you need to change a setting in the theme. Open up “styles.php” and find the “#comic” section. This section has all the settings for the box that the comic itself sits in. You can set the 760 pixel width to any number you need. Also you can set the background color of this area and I’ve even set in dummy borders that you can turn on by changing the 0’s to number, you’ll notice there is currently a 1 pixel gray border at the bottom.

Change the Header

Probably the first thing you’ll want do do is change the header and either replace it with a logo or menu. You’ll need to open up “header.php” and find:

<div id="header">
<h1><a href="<?php echo get_settings('home'); ?>"><?php bloginfo('name'); ?></a></h1>
<div class="description"><?php bloginfo('description'); ?></div>
</div>

You can replace this section with whatever you want, even just a big fat header image (760 pixels wide to fit with the rest of the page). Whatever you place there you should put it in between “<div>” and “</div>” so that it fits together with the rest of the page. You will also need to open the “narchives.php” file and make the exact same change there.

Security! Call Security!

With your files sitting in a folder with preset names by date it is not hard for someone to look ahead at comics. You might not care unless you have a story you do not want spoiled. You might not care because like most webcomic creators your uploading tomorrows strip minutes before your update time. But if you do care there is a quick solution, “encoded” filenames. WordPress creates something called a post slug, it is the title of the post in a directory/filename friendly format, ommitting punctuation and replacing spaces with hyphens. The slug for a post/comic titled “Bob Punches Steve” would be “bob-punches-steve”. You can also edit the post slug, shortening it if you want. Now you name your files with that post slug at the end, so instead of “2005-11-17.gif” you would name it “2005-11-17-bob-punches-steve.gif”. And noone knows that filename to call it up, also it labels the strips nicely for you to keep track of easier.

By default the theme is not going to recognize this new filename system. So you need to make a change to “header.php”. Near the bottom you will find this line:

<?php the_time('Y-m-d') ?>

Replace it with these lines:


<?php the_time('Y-m-d-') ?>
<?php echo $post->post_name; ?>

Include Comic Image In RSS Feed

By default the comic image itself will not be included in your RSS news feed. You may not want to give away that bandwidth without displaying paying ads that may be on your site, or wanting to display the comic outside of your site in general. On the other hand, you may just be interested in everyone reading the comic by any means possible and allowing modern convenience. If that is the case, then adding the comic image to the RSS feed is a very simple step. You will need to edit your “wp-rss2.php” file. Find this line:

<content:encoded><![CDATA[<?php the_content('', 0, '')
?>]]></content:encoded>

You just need to add the code that pulls up your comic image (three lines of the stuff you edited in the header). It should be placed like this (make the proper modifications for your particular comic, also it should all be one line, I had to break it to fit the format here):

<content:encoded><![CDATA[<?php echo '<img
src="http://yourdomain/yourcomicfolder/' ?><?php the_time('Y-m-d') ?><?php echo '.gif" />' ?><?php the_content('', 0, '') ?>]]></content:encoded>

14 Responses to “Tips For Customizing”

  1. tymmi Says:

    I’m not too familiar with using the WordPress platform so forgive me if this is a stupid question.
    Is it possible to allow for variable formatting of the comics themselves?

    All of your examples follow a pretty standard “daily strip” format.
    Will this theme allow a more “sunday comics” format as well. Or a squared format (like American Elf)?

    And if so how much flexability is there to vary the formats between each individual strip?

  2. Tyler Martin Says:

    Yeah, you can swap the size out however you want. I run double-sized sunday strips at my own comic as well.

    http://ontherockscomics.com/2005/06/27/welcome-to-antarctica/

    Mine also extends past the page content width which can be set to whatever you want for the comic separately from the rest of the page.

  3. tymmi Says:

    Awesome.
    This is a really great setup you got going here.

  4. Seren Jeanes Says:

    Can the comic’s width be allowed to vary. For example: My first 7 comics are abouy 1024 px wide. while the rest are about 760. Is it possible to make the size max vary?

  5. Tyler Martin Says:

    Sure, normally you would just set it to the widest comic you have.

    Or if you want it to look more scalable, you can set the comic area background to be the same as the page background, or no background so that it is transparent, and set it to 100% wide.

    If you need any help setting it up or customizing the theme don’t hesitate to ask. =)

  6. Seren Jeanes Says:

    Thanks Tyler…but another question, when I have the really wide comics set up, but I want them centered…how?

  7. Mavis Says:

    I just wanted to pop in and say hi… so… Hi!

  8. Daniel Says:

    This theme was enough to motivate me to really get my comic started. Thanks Tyler!

  9. Pantsman Says:

    This looks like a great theme…I’m kind of a tech newbie, question for you: Will this work if some comics are gifs and others are jpegs? Or do they all have to be the same format?

  10. Tyler Martin Says:

    You can mix it up if you use this modification.

  11. Chad Says:

    I was also wondering how I would center a comic that is wider than the default setting. Thanks!

  12. Farhan Says:

    This theme is brilliant, I’ve been looking all over for a way to use wordpress as a comic engine. :)

    Is there any way I could have the comics showing on a seperate wordpress page? I already have a blog but was looking for a way to display comics on a ‘/comic’ page. Thanks.

  13. Pat J Says:

    Hi,

    Thanks for the brilliant theme. I’m publishing a serial novel online, and with just a few modifications (like replacing the word “comic” with the word “chapter”, for example), I’ll be using this theme.

  14. Pat J Says:

    One note on the narchives.php page — it would not work for me unless I turned off gzip compression. Any suggestions would be appreciated.

Leave a Reply