The Quick & Dirty:

  • 9+ years in the biz, 10 messing around
  • All the latest in HTML, CSS, JS & PHP (Sorry, no .net or Ruby skills yet)
  • Cross-browser compatible code from Photoshop or Illustrator files.. or napkins!
  • Custom Specialities in Wordpress theming & plugins, Twitter & jQuery
  • Subversion, server-log analysis, and blocking hack-attempts (of late).
  • Data/Project Geek. I ♥ timelines.

I’ve compiled some handy PHP functions I’ve had to whip up. More extensive code-samples are also available.

Wordpress-from-Photoshop/Illustrator

Wordpress-from-static HTML

Wordpress-from-Photoshop

Fake out wordpress to pull in another page-content..

Sometimes using <? $thispost=get_post($id); echo $thispost->post_content ?> isn’t enough.

Sometimes, you need a full menu structure to be highlighted or built according to that post.

Sometimes you need a menu parent pull in the ‘first child’ content.

Sometimes, you need to fake wordpress out:

[sourcecode lang="php"]

$wp_query=fakePage($wp_query->post->ID,”6″,”8″,$wp_query);

function fakePage($currid,$thisid,$fakeid,$wp_query){
if(strcmp($currid,$thisid)==0){
$thispost=get_post($fakeid);

//the fake-out
$wp_query->post->ID=$fakeid;
$wp_query->post->post_content=$thispost->post_content;

$wp_query->queried_object->ID=$fakeid;
$wp_query->queried_object_id=$fakeid;
$wp_query->queried_object->post_content=$thispost->post_content;

$wp_query->posts[0]->ID=$fakeid;
$wp_query->posts[0]->post_content=$thispost->post_content;
}
return $wp_query;
} ?>

[/sourcecode]

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
Posted in codeRelease, PHP, wordpress Tagged , , , , , , , , , Comments Off

Comments are closed.