Hacking WordPress
21/03/06 17:33 web-dev
Hacking Benevolence Theme
Making custom templates
The get command template tags call to standard template files. The include PHP command gets template files that are standard AND non-standard template files.
home.php
home.php loses pretty much everything from original index.php - just calls in header, sidebar
sidebar_home.php
TO DO: Get a list of Pages displaying ... (need to include template tag to get Pages) example
<?php wp_list_pages('title_li=<h2>Pages</h2>'); ?>
and following on; to include the "Blog" category (no breaks -
so it is a seamless list). (Blimey - getting php code to render in
html is not nice.DONE: Just remove "Pages" from inside the example above. Donkey.
TO DO: Benevolence Theme needs a (CSS?) solution to render sub-Pages nicely in the sidebar.
IN PROGRESS: using a
.pagenav li.page_item
li selector I can add indent - but it seems
the text color won't change...
(NOTE: since I've had to re-do sidebar_home.php due to it losing all its contents - I'm getting a nice rendering of this. Magic. One thing I changed was to put the php calls to display Pages and Blog inside a title div.)
Hacking the standard templates
header.php
DONE: Commented out bloginfo link from blogTitle div. Knocked out a banner graphic. Very much a v1.
TO DO: do that properly - (perhaps an Image Ready navbar with fancy roll-overs: in the CSS of course)
sidebar.php
DONE:
wp_list_cats('list=0'); replaced
by:
wp_list_cats('sort_column=name&optioncount=1&exclude=2');
where my "Blog" category = 2
footer.php
DONE: easy.
DONE: Created .htaccess file - (WP 2 is not creating the file despite what is says - tried changing permissions (using Transmit) but no joy. ) - added code as promted by WP-admin.
|