Originally Posted by KCBerner
There are still a few things I'd like to get working better but I suspect I'll have to dust off some very rusty HTML skills to make it work:
- Better formatting of the hours spent in individual blog entries. I've got the category totals easy enough but Ed has a nifty "Hours: x" at the bottom of each entry
If you're using the Get Custom Field Values plugin
, it's pretty easy to do, just one piece of PHP code to insert. Note: depending on where you want the hours to show up for each post, you may need to do this TWICE. Here's the bit to insert:
<?php echo c2c_get_custom('Hours', 'Hours: <strong>', '</strong> | '); ?>
...as you can see, the function has three arguments so you can customize the appearance on your page:
: The name of the Custom Field to pull from (this needs to match exactly the name you use when you're entering your hours in each post...which should be the same every time. I use 'Hours'.)
2. 'Hours: <strong>'
: The text (including any HTML tags you want) to print before the field value.
3. '</strong> | '
: The text (again including any HTML tags you want) to print after the field value.
The function takes those three arguments, looks up the value of the specified custom field, and prints the whole thing. The example above would come out (assuming the hours value was 1.3) as:
To output the hours on every individual post page (example
), you need to edit the file named "single.php" in the theme that you're using.
To output the hours on each individual post in the list view -- most commonly your home page
, but also individual category views
and monthly-posts views
-- you need to add it to the file called "index.php" in the theme you're using. (Note that per-post stuff in the index.php page must be inside "the loop", which is the part of the page that is repeatedly processed, one time for each post in the collection...whereas the header and footer, which show your site's menus, sidebars, and such, are processed only once.)
Theme files are usually located in the "wp-content" directory, in a subfolder resembling the name of your theme. Or, you can usually edit them from the "Appearance -> Editor" page in the Dashboard.
I'm always happy to offer pointers on this stuff if anyone gets stuck ... feel free to shoot me a note.
I did print off my entire build log (using an online WordPress -> PDF converter service) and bind it for the DAR inspection and future reference.