Tag Archive for 'hacking'

14
Aug

“Recent comments” added

I had a few folks post comments on some of my older posts, and I didn’t notice them right away. The problem is that I rarely use the WordPress “dashboard”, which is the easiest place to find recently added comments.

For several weeks, I’ve been meaning to bolt the Recent Comments plugin by Krischan Jodies’ onto the Journalized-Blue theme that I use. So I’d like to thank jim wilde, Bitcloud, and RTO Trainer first and foremost for commenting on my blog. Additional thanks are due for giving me the best incentive to get off my butt and get the necessary hacking done! While I was at it, I made some minor cosmetic changes to the interface, the most visible being the longer “top tags” list.

08
Jul

Adding statcounter to WordPress

I’m thinking about using the free statcounter service on my site, but it requires that I add a little bit of javascript to each page. If I was running a single theme, I could probably find all the appropriate </body> tags and just paste in the statcounter code. But I’m trying to support multiple themes; besides, where’s the fun in cutting and pasting a bunch of code? Also, what if I need to change the statcounter code for some reason? So I think the Right Thing to do here is come up with a plugin for the wp_footer action which will insert some user-specified code, (in this case, my statcounter javascript). I haven’t found a plugin for statcounter, so I’ll be searching for a generic footer plugin. If I can’t find anything, I guess I’ll have to roll my own.

28
Jun

To-do list for tags support in other themes

Just thinking about what still needs to be done to get tags support in my other themes…

Steam will need to have 4 files modified:

  • archive.php
  • index.php
  • sidebar.php
  • and single.php

I’ve already modified at least one of these files for other reasons, but I have saved original copies of all the files that have been/need to be modified.

I need to clean up my earlier work on Borderline Chaos, and then add tags support to it. I’ve got the original theme files in another directory, still need to see which files I’ve already changed. Files to be modified for tags support:

  • 404.php
  • archives.php
  • index.php
  • links.php
  • search.php
  • sidebar.php
  • single.php

Sigh…

Elvgren looks like only index.php needs to be modified. I don’t remember if I have already modified this theme, so I’ll need to download a fresh copy.

Journalized-Blue and Sharepoint Like are already finished. The WordPress Default and the pirate theme (”Yaaarr, ’tis me blog!”) will probably remain tag-less, and may even be deprecated. The WordPress Classic theme will certainly be removed.

26
Jun

Nothing new here, but check out cvntrak.org

Nothing’s been going on here since I’ve been busy hacking up Central Valley NTrak, my model railroad site. It’s now a full WordPress site–all content is managed by WP. I learned a few things about Pages (note the capital “P”) and hierarchal categories which I thought I would share. (Or at least write down, so I don’t have to re-learn them the hard way!)

The site is using a modified version of BB Iverson’s theme, Spirit, which has a few non-post Pages linked from the header. Creating the pages sounded pretty easy, so I jumped in. I got the pages created okay, but I couldn’t view them–I kept getting 404 errors whenever I tried to browse cvntrak.org/archives/. I thought perhaps I had set the page template incorrectly, or perhaps I should have titled the page “archives” instead of “Archives”. I tried all kinds of things, to no avail. Eventually I found a reference to “the default ‘pretty’ permalink format”, so I double-checked that I had indeed set these up correctly, and found my problem–I had turned off write access to my .htaccess file after I got the permalink format set initially, and there were a whole bunch of new rewrite rules to be added for the new Pages I had written. I played with this a little bit more, and it seems like you need to visit the Options/Permalinks page and hit “Update permalink structure” whenever you create a new Page. I tried leaving .htaccess writable, then creating a Page, then viewing it, and I always got 404’s for pages created after the most recent permalink update. I don’t like leaving this file writable, so I’ll just cut-and-paste if I ever need to change the rewrite rules again.

“Spirit” has a category list in the left sidebar, generated by wplistcats(). I set up hierarchal categories for this site, with a couple of top-level “container” categories. Then I made the first post and filed it under the child categories, published it and viewed the home page and wplistcats showed… nothing! I futzed around with this for a while and finally I made a post in one of the top-level categories. Voila! All of a sudden I can see the category hierarchy in the sidebar, at least for all children of the top-level category with a post. I have to play with this some more to see exactly when it breaks. I’m not sure if this is a bug, or maybe I don’t completely understand how wplistcats() is supposed to work.

23
Jun

New parameter for list_tags() cleaned up Sharepoint theme

A bit of hacking on Felix’s tags plugin (version 0.3.0) has cleaned up the Sharepoint theme. I added a new parameter, “countposts” (default true), to the listtags() function. This controls the display of number of posts. The patch is here, just right-click and save locally or use your browser’s “view source” command.

This code could probably be much cleaner, but it gets the job done for me right now. Enjoy!

Update: 2005-09-03 05:36 UTC–the patchfile has been fixed. See this article for more info.

23
Jun

Tags added to Sharepoint, but they’re ugly

I’ve got tags working in “Sharepoint like”, but the tags list (left column) looks pretty ugly. The CSS for this theme doesn’t work well with the output of listtags(), since the CSS sort of expects category listings to contain only anchors (<a>), while listtags() outputs an anchored tag name followed by the article count as plain text.

This is a bummer. I really like the Sharepoint theme, and I much prefer tags over categories. I may have to hack the tags plugin to add a function to list the anchored tags without article counts, or perhaps add another parameter to the list_tags() function to control this.

It’s getting late, I think that’s enough theme hacking for one night. I’ll look at this with fresh eyes in the morning.

23
Jun

Tags support finished on J-blue

I finished hacking up Journalized-Blue to support the tags plugin. Since this is the only theme I have finished (wrt tags), I have made this the default theme for my blog.

Replacing categories with tags for this theme turned out to involve only two files, index.php and leftcolumn.php. Patches for both files are below. I made the theme “tags aware”, so if you have the tags plugin, the theme will show tags wherever it now shows categories. If you want both tags and categories, it’d be very simple to hack the patched files so that categories were always displayed.

The patches are .txt files. I can’t recall how to force these to display “as is” (my http-fu is weak, I’ll admit), but you can either right-click on these links and save the files locally or simply click on the links and then use your browser’s “view source” command to see the straight .txt files.

Update: 2005-09-03 05:32 UTC I’ve created a single patchfile of all the changes I’ve made to Journalized-blue. More information is available in this article.

22
Jun

Added tags support to J-Blue theme

I hacked up Journalized-Blue’s index.php to replace the category listing with Felix Wong’s tags plugin. I still need to grep the rest of this theme for categories and fix them as well. Then I’ll have to see which of the rest of my themes are worth the effort. (I guess it’s not that tough to add tags support, it’s just a matter of finding all the places where categories are listed in all of the theme php files.)

I should probably also be a good citizen and post the modified themes.

17
Jun

Borderline Chaos not honoring date format?

A fix to the awesome Borderline Chaos theme. I started noticing that my blog’s date format wasn’t being used, so I started poking around some more in the theme files. I found a couple of places where hard-coded date formats had been used. The following patches take care of these issues. Careful! I have been fiddling with the theme files already, so my line numbers may not match the master files’. A little human intervention may be needed, and the patches only involve three or four lines of code changes so it’s no biggee to take care of this manually.

index.php patch single.php patch

I tried using the function “the_date()” out of template-functions-general, but it’s a little too smart for its own good–this function automagically hides the date if it’s the same as the “previousday”, i.e. if the first two posts are dated the same, the date will show up on the first one but it will be suppressed on the second one.

Update: 2005-09-03T05:26 UTC As mentioned in this article, I created a single patchfile containing all the changes I made to Borderline Chaos. I’ll document these later.

17
Jun

New theme(s) installed

I went searching for a new theme yesterday. Don’t get me wrong–the default theme is very nice, easy to read, etc., but I just couldn’t bring myself to use the “just another WordPress blog” theme. Also, I wanted a theme that took advantage of the full width of the browser window.

The WRC Theme Viewer is an awesome tool for checking out a huge number of available themes, and I went through every single one of them. (Took me a while, even with a fat pipe at home.) I found about 20 themes that had feature(s) I liked and/or looked nice. I’ll list all ~20 of them, along with my impressions, in another post. But the two that I decided to install are Elvgren and Borderline Chaos.

I love Denis Somar’s Elvgren theme. The layout suits me, especially the article appearance. The font styles and colors for the articles are very well-chosen, IMO. The Elvgren prints are gorgeous, but they are also the reason I chose not to make this my default theme–the bandwidth required for this theme could be a killer for some users. (Until very recently I had been stuck with a 33kb/s max pipe, and bandwidth considerations are still very important to me!) But since I like this theme so much, I installed a theme switcher plugin so that my readers (all 2 of them) can choose their preferred theme. (More on this below.) This theme worked great for me “right out of the box”, so I haven’t tweaked it (yet).

I chose Marianne’s Borderline Chaos as the site default. I love the bold, striking look of it! And the theme overhead (wrt bandwidth) is almost nil. There were a few things I needed to tweak on this theme. On the nit-picky side, I didn’t like the way my blog title wrapped, so I made that box a fixed width instead of using a width percentage. But the major problem I had with this theme was lack of a “Site Admin” link. Perhaps I’m a complete moron and there’s a knob for this somewhere, but I didn’t find it upon cursory inspection. So I added a “Meta” sidebox and put the appropriate stuff inside it. This caused me to run out of box styles, and instead of doing the simple thing (adding another sidebox style in style.css) I let a brain-o slip and renumbered all the sideboxes, getting rid of the “Pages” sidebox. I’ll go back and fix this tonight. Sigh.

Theme switching (along with everything else about blogging and WordPress) is new to me. I found this tutorial for Ryan Boren’s wpthemeswitcher to be a big help. Who would have thought that theme switching could be this easy? I added theme-switcher code to the WordPress default theme, so now all my themes (except Classic) can be selected on-the-fly by individual readers.

Many thanks to all the authors/designers mentioned in this post! Pingbacks are on the way, but I’ll be leaving comments on everybodys’ blogs “in person” as well.




November 2008
M T W T F S S
« Oct    
 12
3456789
10111213141516
17181920212223
24252627282930

Tags

abramoff accessibility acetylene activism aerial photo afrofunk aim4tree air america airport express alite alito amtrak andante andy anti failure any browser apache apple applescript arden arcade arden park ariana arnold ashland astronomy attic attika audio avid reader backup baen bart bathroom bbq bee beef begonia bgg bike bike hikers bike journal bikejournal biketalk bill oreilly bittorrent blacklist blog bloggercode blogroll blueberry boardgamegeek boardgames bonjour book bookcrossing boot failure bootcamp borderline chaos bugmenot bush business card cabinetry caira caitlin california candamir caroline carpet cat cateye cdrom celebration cellular phone century cheese chicken chico chimney chinese chipotle chocolate christmas chumby city bikes civilization cjd claire club club fed co op coconut coffee comfort food community computer concord congress conquest conservation consumer reports copyright costco crazybikerchick crepe crock pot cruftbox css csus curl currency custard cvntrak dagoba daniel goetz darwinports datarescue date format death delicious monster democracy now Democrat demolition dessert dickens diff disaster discrimination discworld dishwasher diskwarrior dixie belle dock doors downing street memo drm dryer drywall dump ed burke eff eggs eject election electric car electric truck electrical electricity elvgren email energy efficiency eric meyer esr etext euthanasia facebook family faq faux news feed feedreader fence finder firefox first4internet first amendment fishmeal flash flickr flooring foreign exchange foundation fox and goose framing freebsd freedback fyq garage garden geek geotag geourl gnutar go gonuls google google earth google maps gpl gracenote graywater greek green group concat gtd gunthers gutters gwbush gymnastics hacking halloween handspring hardwood harry potter headmeta high speed photograph high tech inv hoax hobbies hobby hodgins holiday holly home power magazine horcrux houseblogs how to html humor hvac ilovejackdaniels impeach inspection insulation intel internet ipod ipodder iq iraq isight itunes ivins iwantsandy java city javascript joint chiefs joseph jott journalized blue judges cup kctc khs kimkerry kitchen kyocera la salles la times labor landscape laundry law leatherbys legal lego leopard lhc liberal library linkedin ljurban lodi logic logo lungren maaloufs mac macbook mailinator malware map marin markdown mason media media clip media reform meetup metric mexican microsoft mike comfort military milonic mindstorms mlk model railroading modoc hall monterey morning sedition motorcycle movie moving munchkin murray mushroom music mynetflix mysql naked lounge nerd score netflix network new urbanism new year New Yorker nofollow nutella oatmeal obama obcz occidental occupation omni openssl oracle organic osx owp paint pair palast palm panasonic parallels party patch peak adventures peak oil pear pedestrian village perl petaluma php ping pingback pingomatic pingomation pingqueue pirate pl sql planet bike plasma playroom entertainment plugin plugin:preview theme plugin:text control plugin:ultimate tag warrior plumbing podcast podsite politics portupgrade potato powerbook printer programming project gutenberg pryde punk puzzle qiana quilt quilt shop quiz quote r5 records racism radio railroad recent comments recipe redalt remodel resaurant resolution restaurant restore review richmond rio americano robotics roger niello ron montana roof rootkit rss sacbee sacog sacramento sacramento spotlight magazine salad san francisco sandwich santa cruz scam scandal school days scplugin security session report shakespeare shuffle sigma siriradha sitemap snl snopes social social network software soma somafab sonicchicken sonicchicken blog sony spam spam karma spellcheck spinach spirit spoiler etiquette spring hill cheese sql sqlserver stairs standards statcounter stephen king stop loss stucco stunt subversion sudoku superbowl superhero supreme court sushi svn sysadmin tacoma tags plugin takara technology telephone television template terms and conditions textcontrol thai kitchen thanksgiving theater theme theme:borderline chaos theme:elvgren theme:elvgren wordpress google code theme:fluid blue theme:fullwidth theme:head theme:journalized theme:journalized blue theme:psycho theme:redoable theme:sharepoint like theme:simple green theme:spirit theme:steam theme:wuhan theme:yadda theme switcher thomas tigris euphrates tile tinfoil hat toc tofu tower theater training transit transit oriented development tribute u haul uneasy rhetoric university village van zant veterans day video vie viking hobby vote smart w3c wall warboss washer washington post weather web web developer web server wikipedia windows wishlist woodworking wordpress workplace wpblacklist wpgatekeeper wsj yaaarr yard