Posted By

paulgrenwood on 09/23/09


Tagged

wordpress series customfields


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vagrantradio


Custom Fields - Create a Post Series


 / Published in: PHP
 

This is something that I wished I’d thought of a long time ago – show other posts in the same series using not a plugin but custom fields. All you’ve got to do for this trick to work is create a custom field ‘Series’ with a link to each other post in the series. Each post must be a seperate custom field. Then, use the code below to display all the other posts in the same series!

  1. <?php $series= get_post_meta($post->ID, 'Series', false); ?>
  2. <h3>Also in this series:</h3>
  3. <ul>
  4. <?php foreach($series as $series-post) {
  5. echo '<li>'.$series-post.'</li>';
  6. } ?>
  7. </ul>

Report this snippet  

You need to login to post a comment.