Skip to content

Instantly share code, notes, and snippets.

@raselahmed7
Created September 23, 2014 02:19
Show Gist options
  • Save raselahmed7/955815fa9f34361fef78 to your computer and use it in GitHub Desktop.
Save raselahmed7/955815fa9f34361fef78 to your computer and use it in GitHub Desktop.
Custom post query with custom field wordpress
<?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; ?>
@shahadatbipu
Copy link

Dear Rasel Vai
hi,
Firstly take my honor cause i watch your youtube tutorial while i get time .
i m shahadat from Narayanganj .Actually i revert to u for knowing is that "how will i add learn more button with link ?"

@shahadatbipu
Copy link

i mean to say in wordpress cause i have seen your tutorial html to wordpress of Moderna.There was missing in service section how did u add learn more button with custom field ? if u show it again then ?

@mosharafmanu
Copy link

Thanks

@TANVIRFAZLEY
Copy link

Thanks for this gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment