Code snippets from my WordCamp presentation

By Morten Rand-Hendriksen on

Here are some code snippets from my WordCamp Whistler presentation. This article will be expanded in the coming week but in the meantime here they are for anyone wanting to play around with them:

Custom Page Templates in 5 lines of code

<?php
/*
Template Name: Whatever
*/
?>

Custom Fields in one line of code

<?php echo get_post_meta($post->ID, '$key', true); ?>

Custom Field that parses PHP code

<?php $boxContent = get_post_meta($post->ID, 'centerBox', true); ?>
<?php eval('?'.'>'.$boxContent); ?>

4 comments

  1. Not officially sent by NetChick (this round) but thought I’d check all the other blogs out. Then I realized that I’m glad I came here to offer a “thank you” for the video you guys (Dabbler) did for us a year and a bit ago. Hurray!

    Anyway, I’ll definitely add you to my feed reader now. :)

    C.

  2. Pingback: WordCamp Victoria Presentation: 10 Theme Hacks to Improve Your Site | The best Tutorials

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">