Advertisement
raselahmed7

Usage Custom Field in custom post query

Nov 23rd, 2013
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. Custom post default
  2.  
  3. <?php $job_link= get_post_meta($post->ID, 'job_instructions', true); ?>
  4. <?php echo $job_link; ?>
  5.  
  6.  
  7. Custom post if exists
  8.  
  9. <?php if($job_link) :  ?>
  10.     <a href="<?php echo $job_link; ?>" class="job_pdf">Download Instructions</a>
  11. <?php endif; ?>
  12.  
  13.  
  14.  
  15. Custom post dynamic
  16.  
  17. <?php if ( $job_link ) : ?>
  18.     <a href="<?php echo $job_link; ?>" class="job_pdf">Download Instructions</a>
  19. <?php else : ?>
  20.     <p style="float:right">no job instructions available</p>
  21. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement