Skip to content

Instantly share code, notes, and snippets.

@asufian97
Created October 13, 2017 09:48
Show Gist options
  • Save asufian97/aef94fcf503db38309c03311d831de0c to your computer and use it in GitHub Desktop.
Save asufian97/aef94fcf503db38309c03311d831de0c to your computer and use it in GitHub Desktop.
custom-post-query
<?php
global $post;
$args = array( 'posts_per_page' => 10, 'post_type'=> 'custom-post-type' );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<?php
$job_link= get_post_meta($post->ID, 'job_instructions', true);
?>
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
<p><?php echo $job_link; ?></p>
<?php endforeach; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment