This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Custom Post Type if-statement

By: a guest on Oct 8th, 2012  |  syntax: PHP  |  size: 0.65 KB  |  views: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php if ( 'lettering' == get_post_type() ) {
  2.  
  3.     if( function_exists( 'attachments_get_attachments' ) ) {  
  4.                         $attachments = attachments_get_attachments();
  5.                         $total_attachments = count( $attachments );
  6.                         if( $total_attachments ) : ?>
  7.                         <ul id="process"><span>Process:</span>
  8.                         </ul>
  9.                         <br>
  10.                                 <?php endif; } ?>
  11.  
  12. } elseif ( 'type' == get_post_type() ) {
  13.  
  14.         if( function_exists( 'attachments_get_attachments' ) ) {
  15.                         $attachments = attachments_get_attachments();
  16.                         $total_attachments = count( $attachments );
  17.                         if( $total_attachments ) : ?>
  18.                         <ul id="process"><span>Additional Shots</span>
  19.                         </ul>
  20.                         <br>
  21.                                 <?php endif; } ?>
  22. }
  23.  
  24. ?>
clone this paste RAW Paste Data