Tag: Wordpress

Flip WordPress Plugin

December 28, 2010 » Geek

So I took a few minutes and slapped together a plugin for WordPress that lets you “flip” your website upside down. I basically just packaged up the code from the last post.

Grab a copy here: https://github.com/jmhobbs/Flip. It works for me in Firefox and Chrome.

WordPress jh_random_cats()

February 5, 2007 » Geek

Got bored and scratched another itch I’ve had in wordpress for a while. I always wanted a way to list my categories on the sidebar on my terms. The best I had found was the well written and executed Category Visibility-RH but I wanted to choose from all my categories and still limit the number listed.

I added a function to my wp-hacks.php and then dropped it into my sidebar. Does the job, and could easily be edited. I swear someday I’ll learn how to make plug-ins, really.

As a super-cool extra I got to use a PHP function I had never gotten to use before, let alone knew existed: bool shuffle ( array &array ). It, you guessed it, shuffles up an array.

WordPress: more_posts, old_posts, new_posts

January 24, 2007 » Geek

I just scratched an itch I’ve had for a long time. I always hate how on my category pages and my archive pages the little “More Posts” box would display even if there were no posts. Also, I could never check and see if there were no “Newer” or no “Older” posts so I could still print the words out in non-link form.

I finally did something about it today. I started by looking through the codex, and finding nothing. So I started digging through the WP code looking for the posts_nav_link() which sorta did what I wanted, but just echoed to the page instead of returning. I found it in wp-includes/template-functions-links.php and started chopping it up.

In the end I came up with three functions for my ‘my-hacks.php’ file. I didn’t want to spend the time making it into a plugin since it’s not that big a deal. They aren’t terribly efficient, but they work and thats what matters. Also, I pre-pended jh to the function names so there wouldn’t be any chance of collisions.

Returns true if there are more posts, newer or older.

Returns true if there are more ‘older’ posts.

Returns true if there are more ‘newer’ posts.

More WordPress Stuff

August 28, 2006 » Geek

So I’ve gotten all the posts over from the old system. I’ve had alot of trobule with getting iG:Syntax Hiliter to behave, though it’s mostly my own fault for not understanding the options and the styling. The “plain text” links still weren’t working, so I took them off.

I’ve been finding little flaws in the theme here and there, and just today created a home.php to override the index and give this nice custom job, more like the old page. I also had problems getting scrobbler to work. I finally realized it wasn’t scrobbler that was messed up, it was wp-cache making the dynamic last.fm content into cached copies.

I figured that out after pulling scrobbler and inserting my own last.fm code straight into the template. Not the best solution, but I never intend on releasing this template as public anyway.

Still chugging away at the static site, should have some of my content back soon.

Tags: , ,

Hello world!

August 27, 2006 » Geek

Well, I’ve gotten the new wordpress up, and finished up (I hope) my theme here. Hopefully there aren’t any little glitches in it, I’m bad at testing code out. Now I’ll start porting in all the content from the old site, which I’ve moved to static.velvetcache.org.

Don’t bother going there though, I hardcoded too much of the Smarty engine into it and so everything is broken since it’s moved to a new domain. Yet another thing to grep and fix :) Oh well, I really like wordpress, so it’s worth it.

Also, maybe it’s just me but I’m having issues with loading some pages, I think wp-cache is buggy, something else to figure out. If something doesn’t load, just try a few refreshes, sorry.

Update: Found the offending line of code, wp-cache should work nicely now :)

Tags: , , ,