Customizing wordpress
Aug 4th, 2007
Welcome to my first ‘main’ wordpress post. I call this a main post, as I also setup a secondary section which is dedicated for ‘Fun’ posts. I’ll go over the various customizations I did to get this blog up and running. I like to keep track of these kind of small technical tweakings and I thought it will be nice to start out with a post about the blog itself. I’ll keep it short and try to focus on the non trivial parts as overall setting up a blog is considered basic these days.
Well, as a start I am using wordpress as the blogging engine. This was easy to setup as my hosting provider (godaddy) has a pre-configured one-click setup process. The next challenge was to customize wordpress to a satisfactory level. I started out by search for a more interesting template than the provided default. I came across the MisyLook template. I liked this template but I decided to change it a little.
First off I wanted to remove the header in each section stating by who is the post. As currently I am the only one posting I find this unnecessary. I did a quick look at the html and php of template and found that the following line was responsible for the “by …” text: by <?php the_author_posts_link() ?>. So all that was required was to remove this line. A simple sed command on the relevant files was sufficient:
sed -i 's/by <?php the_author_posts_link() ?>//g' *.php
Next, I wanted to separate between posts which are more fun oriented (these will hopefully include pictures and videos from experiences in life) and regular ramblings, which will probably be more tech oriented. I decided to add an additional page which will basically display the ‘Fun’ oriented posts. I created a custom category page, which is basically a copy of the index page and named it: categeroy-2.php. This page is displayed every time the ‘Fun’ category is chosen, according to the resolve preferences of wordpress (more about this here). I also wanted to add a tab to the top navigation for the ‘Fun’ category. I did this by simply modifying the template header file and adding the following after the home tab list item:
<li <?php if(is_category('Fun')){echo 'class="current_page_item"';}?>><a href="<?php bloginfo('siteurl'); ?>/category/fun/" title="Home">Fun</a>
</li>
Finally, I don’t want to display the ‘Fun’ posts on the main page so I added a conditional in The Loop of index.php to only display posts that aren’t part of the ‘Fun’ category. First I fetch the Fun category id:
$funid = get_cat_ID('Fun');
Then I can use the following conditional:
<?php if ( !in_category($funid)) : //only post non fun posts ?>
Well, that’s pretty much it. Now I have my blog setup and all that is left to do is to actually start blogging….
I couldn’t understand some parts of this article Customizing wordpress, but I guess I just need to check some more resources regarding this, because it sounds interesting.
This is my first post
just saying HI
Hi!
I want to improve my SQL experience.
I red so many SQL resources and want to
read more about SQL for my work as oracle database manager.
What can you recommend?
Thanks,
Werutz
Werutz,
Kind of weird that you got to post this question on this Blog, as this is not the place for SQL resources.
Might be some kind of bot posting this.
Guy