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

content no show

By: cw17s0n on Apr 10th, 2012  |  syntax: PHP  |  size: 1.82 KB  |  views: 22  |  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
  2.         $today = date("F");
  3.         $supplier = get_the_title();
  4.         $sani_supplier = sanitize_title($supplier);
  5.        
  6. // *** echoes sanitized title
  7.         echo "1".$sani_supplier;
  8. // *** echoes title
  9.         echo " 2".$supplier;
  10.  
  11. ?>
  12. <!-- Left Nav-->
  13.  
  14. <!-- Content-->
  15. <?php
  16.         global $post;
  17.         $args = array(
  18.                 'numberposts' => 1,
  19.                 'post_type' => 'suppliers',
  20.                 'taxonomy' => 'suppliersTax',
  21.                 'term' => $sani_supplier,
  22. // *** 'suppliersTax' => $sani_supplier, <--went back to way I was doing before, was ignoring the arg
  23.                 'post_status' => 'publish'
  24.         );
  25.  
  26. // *** echoes sanitized title
  27.         echo "3".$sani_supplier;
  28.  
  29.         $homeSOTMHeader = get_posts( $args );
  30.  
  31.         foreach( $homeSOTMHeader as $post ) :   setup_postdata($post);
  32.  
  33. // *** only echoes sanitized title when title is a single word, otherwise nothing
  34.         echo " inside foreach".$sani_supplier;
  35. ?>
  36.  
  37. <div id="supplierHeader">
  38.         <div id="supplierLogo" class="alignLeft">
  39.                 <?php if ( has_post_thumbnail() ) {the_post_thumbnail();} ?>
  40.         </div>
  41.  
  42.         <ul id="companyHeaderInfoHorizontal">
  43.         <?php
  44.                 $meta = get_post_meta(get_the_ID(), 'sp_homeHeaderCompanyLink', true);
  45.                 '' != $meta and print "<li><a href='$meta' target='_blank'>Company Site</a></li>";
  46.                 $meta = get_post_meta(get_the_ID(), 'sp_homeHeaderProductsLink', true);
  47.                 '' != $meta and print "<li><a href='$meta' target='_blank'>Browse Products</a></li>";
  48.                 $meta = get_post_meta(get_the_ID(), 'sp_homeHeaderContactsBox', true);
  49.                 '0' != $meta and print "<li><a class='inline' href='#contactsModal'>Contacts</a></li>";
  50.         ?>
  51.         </ul>
  52.  
  53.         <div id="sotmSeal" class="alignRight">
  54.                 <?php $meta = get_post_meta(get_the_ID(), 'sp_SOTMMonth', true);
  55.                 if ($today == $meta){ ?>
  56.                         <img src="<?php bloginfo('template_url'); ?>/images/SOM_Seal.png" />
  57.                 <?php } ?>
  58.         </div>
  59.  
  60. <?php endforeach;?>
  61. <?php wp_reset_postdata(); ?>
  62. </div> <!-- supplierHeader -->
clone this paste RAW Paste Data