Tutorials, WordPress Themes, WordPress as CMS

Code snippets from my WordCamp presentation

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); ?>

Related posts:

  1. Using WordPress in Alternate Configurations – My WordCamp Whistler 09 Presentation Finally, after a full week of catching up, here...
  2. Using Conditional Custom Fields for Advanced Layouts An often overlooked function in the WordPress arsenal is Custom...
  3. WordCamp Whistler Pitch: Moving Beyond the Blog – Building Web Sites with WordPress as the CMS WordCamp is coming to the wonderful winter wonderland of Whistler...
  4. Speaking about WordPress as CMS at WordCamp Whistler – What do you want me to cover? I am speaking at WordCamp Whistler on January 24th on...
  5. New WordPress-based Site: AnnyChih.com Two weekends ago my sister-in-law Anny Chih asked for some...

3 Comments

Trackbacks / Pingbacks

Leave a Reply