With a little side of applesauce...

Thursday, February 1, 2007

Wordpress Modification Notes

I am new to Wordpress, but have found it very much to my liking. There seems to be a good community supporting it, and the ease with which I was able to bring it up was nice. Here are a few notes about a features that I didn’t find very intuitive:

1. I plan on using this blog for posting a lot of notes about computers and programs, (including patches and source code). Therefore, I installed the Code Auto Escape plugin from Priyadi Iman Nurcahyo, which helps maintain the formatting of my source code examples:

Priyadi’s Place » Blog Archive » WordPress Plugin: Code Autoescape

2. I wanted to change the header image to include our image from the http://www.erikin.com site. I am using the “default” template, (which I like very much :) ), so I opened path_to_wordpress/wp-content/themes/default/header.php, and made the uncommented:


/* To ease the insertion of a personal header image, I have done it

in such a way, that you simply drop in an image called 'personalheader.jpg'

into your /images/ directory. Dimensions should be at least 760px x 200px.

Anything above that will get cropped off of the image.

*/

/*

#headerimg { background: url('/images/personalheader.jpg') no-repeat top;}

*/

And changed it to:


/* To ease the insertion of a personal header image, I have done it

in such a way, that you simply drop in an image called 'personalheader.jpg'

into your /images/ directory. Dimensions should be at least 760px x 200px.

Anything above that will get cropped off of the image.

*/

/*

#headerimg { background: url('/images/erikin_mountain_new.jpg') no-repeat top;}

*/

I changed the default personalheader.jpg, as I find it easier to keep the namespaces from clashing, (and to find my modifications later).

3. I wanted to add hyperlinks to the sidebar for some of my important sites. Since I am a newbie, I am assuming that there is really a better way to do this, but I just hardcoded the hyperlinks in path_to_wordpress/wp-content/themes/default/sidebar.php. I changed:


<?php wp_list_pages('title_li=
<h2>Pages</h2>
' ); ?>
<li>
<h2>Archives</h2>
<ul>
<?php wp_get_archives('type=monthly'); ?></ul>
</li>


To:


<?php wp_list_pages('title_li=
<h2>Pages</h2>
' ); ?>
<li>
<h2>Links</h2>
<ul>
<a xhref="http://www.dentonbible.org">Denton Bible Church</a></ul>
<ul>
<a xhref="http://www.erikin.com">EriKin Corporation</a></ul>
<ul>
<a xhref="http://www.unt.edu">University of North Texas</a></ul>
<ul>
<a xhref="http://www.unt.edu/webinfo">UNT - Central Web Support</a></ul>
<ul>
<a xhref="http://www.unt.edu/slis">UNT - School of Library and Information Science</a></ul>
</li>
<li>
<h2>Archives</h2>
<ul>
<?php wp_get_archives('type=monthly'); ?></ul>
</li>

This placed my links between the Pages and Archives sections. An interesting trick that I found when trying to add these hyperlinks, was to create a page with the name of the site (ie EriKin Corporation), then add a meta-refresh tag to the page:

<meta http-equiv="refresh" content="0; url=http://www.erikin.com/index/" />

It wasn’t what I wanted, but is something that I will file away for future reference.

4. I wanted to add a copyright notice and a link to the footer. I did this by making the following changes to path_to_wordpress/wp-content/themes/default/footer.php:

<div id="footer">

<?php bloginfo('name'); ?> is proudly powered by
<a xhref="http://wordpress.org/">WordPress</a>

<a xhref="feed:<?php bloginfo('rss2_url'); ?>">Entries (RSS)</a>
and <a xhref="feed:<?php bloginfo('comments_rss2_url'); ?>">Comments (RSS)</a>.

<!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. --></div>



To:

<div id="footer">
&nbsp;&#xA9;2006 <a xhref="http://www.erikin.com">EriKin Corporation</a>


<?php bloginfo('name'); ?> is proudly powered by
<a xhref="http://wordpress.org/">WordPress</a>

<a xhref="feed:<?php bloginfo('rss2_url'); ?>">Entries (RSS)</a>
and <a xhref="feed:<?php bloginfo('comments_rss2_url'); ?>">Comments (RSS)</a>.

<!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. --></div>


Unfinished Business:

1. I can’t get mail posting to work. The path_to_wordpress/wp-mail.php returns:

There doesn’t seem to be any new mail."

Though I can see two messages in the /var/mail/bloguser file. Also, /var/log/myphp3server.log shows that Wordpress is logging in and checking the mail… Hmmm… I need to work on debugging this… (Perhaps using netcat?)

2. I couldn’t place an EriKin icon in the footer. For some reason, the icon and link would be stripped out of the footer.php code when it was being rendered. Therefore, I have simply settled on using the text link, (just like the links to Wordpress, etc. at the bottom of the page. Is the CSS stripping out the icon?

No comments: