‘ Adventures in Coding ’ Archive

Long needed update to my WordPress theme…

I originally created my wordpress theme back in 2007.. before widgets and nifty menus etc… hence it was frustrating having to code in widgets I was interested in by hand so nothing got added or updated.

This week I’ve spent time updating some of my own sites. Back in April I got a SmugMug account which I wanted to style a bit. I finished that on Monday and then decided it was time to tackle my WordPress site. I knew I wanted to keep the basic look I’ve had but wanted to bring it into the WP3.0 relm with support for Menus and Widgets.

I just put it live this afternoon… there is still more I want to do with it. Specifically I want to code a slide out sidebar for on the single posts pages and check out some of the SmugMug/Wordpress plugins. But this will do for now – I think it is much better than I had before..

 

YAPB and other changes to my WordPress

This weekend I decided to add a photoblog plugin to my WordPress. It is hard to believe that I started this blog 18 months ago in December 2007. Unfortunately, I really haven’t had much time to play around with it to get it to do the things I’d like it to. Not to mention the keep up with the changes WordPress has undergone in that time. Typically the only time I play with my own sites is when I’m not feeling well. Something about working with code on something non-work related is semi-relaxing to me. Thanks to the major change in my schedule due to having a son in middle school my sleep schedule is completely off which means I fought with migraines this past weekend… and so I played with my WordPress blog – demented I suppose…
Continue reading “YAPB and other changes to my WordPress”

Now Reading Plugin

I’ve been using the Now Reading Plugin by Rob Miller as a means of keeping track of the books I read. I encountered a problem a couple months ago in that it was no longer able to retrieve books from Amazon and so I had to enter them manually.

Yesterday I came across A Modest Construct which has a post on Now Reading for WordPress 2.7+ this version actually works! I like how Helio has made adding a book manually always available. Something of note however is that when you add a book manually, you don’t have the option to include or later edit an ASIN.

I started looking around the code and found where to make a few simple additions to allow the editing of the ASIN of a book.

In the file admin-manage.php, after line 126 add:

<tr class="form-field">
<th valign="top" scope="row">
<label for="asin-0">' . __("ASIN", NRTD) . '</label>
</th>
<td>
<input type="text" class="main" id="asin-0" name="asin[]" value="' . $existing->asin . '" />
</td>
</tr>

Then in the edit.php file, after line 49 add:

$asin = $wpdb->escape($_POST['asin'][$i]);

and after line 104 add:

b_asin = '$asin',

And now the ASIN number is editable when you edit the book… having an ASIN number for a book allows the plugin to create the links to amazon. It annoyed me that half my books had links and the other half did not.

Now that I have managed to get the plugin actually working, I might look at actually styling the individual book pages…

WordPress Lessons Learned

My Adobe CS4 Master Collection arrived on the 23rd… since it was my son’s birthday I didn’t do much with it beyond install… an install that seemed to take forever.. Before installing, I decided to uninstall the CS3 programs that aren’t in high use… Contribute was in that batch leaving only Photoshop, Illustrator, InDesign and Dreamweaver on my system…. Only thing is for some reason my wordpress was being odd and wouldn’t let me connect with Contribute CS4 so decided to try reinstalling CS3. I thinks the re-install of that one program took as long as CS4 total as it kept making me switch between CS3 and CS4 disks. So lesson learned – make sure you really don’t want the CS3 items before uninstalling. Still not sure what was causing the issue as the same settings seem to work fine now on CS4… might have been something quarky with the server.

Friday I felt pretty miserable with a migraine so I didn’t do much of anything. Saturday morning I played around with the battles I had missed on the NAPP boards the past several weeks. See previous post.

Yesterday afternoon/evening I decided I was going to finally tackle the “Library” section and actually customize it a bit. Once I got the books lining up nicely (View the Library) I decided I had finally had enough of the “Currently Reading” showing up on the Library pages and the home-is() wasn’t really working. I found a great solution on Blue Mushroom which suggested modifying the functions.php page..

While that worked great, I also happened to add an absentminded extra return after the ending ?> which apparently causes problems with WordPress… My entire Dashboard disappeared until I found the offending carriage return and deleted it. So second lesson learned – don’t have extra carriage returns in your WordPress php files.