Skip to content

Instantly share code, notes, and snippets.

@ryarwood
Last active February 3, 2016 17:30
Show Gist options
  • Save ryarwood/1c3550be4c0604c39af8 to your computer and use it in GitHub Desktop.
Save ryarwood/1c3550be4c0604c39af8 to your computer and use it in GitHub Desktop.
Using a custom field to populate a custom post loop.
<?php $newsFeed = the_field('player_feed'); ?>
<?php query_posts('showposts=10&category_name='.$newsFeed.'&ignore_sticky_posts=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
<?php endwhile; wp_reset_query(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment