Advertisement
misionpilot

2011 Theme custom taxonomies

Dec 3rd, 2012
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.92 KB | None | 0 0
  1. <?php
  2. /** This is the begining of my experiment*/
  3. ?>
  4.    
  5.     <?php
  6.     // We need to tell WordPress to look for our custom taxonomy lists
  7.     $hp3_topic_lang_text = "";
  8. // Then we need to tell it which one we want in particular and store it for use in our code.
  9.                     $hp3_top_lang_list = get_the_term_list( $term->ID, 'hp3_top_lang', 'and contains information about ', ', ', '' );
  10.                     if ( '' != $hp3_top_lang_list ) {
  11.                       $hp3_topic_lang_text .= "$hp3_top_lang_list\n";
  12.                     }
  13.     // Now we need to tell WordPress exactly how we want to display the tag
  14.                     if ( '' != $hp3_topic_lang_text ) {
  15.                     ?>  
  16.  
  17. <!--// This just let's WordPress know that there's an else argument. It will remove the 'In this post' if no artists have been tagged.  -->
  18. <?  
  19.     }  
  20. ?>  
  21.  
  22.    
  23. <?php
  24.     // We need to tell WordPress to look for our custom taxonomy lists
  25.     $hp3_content_lang_text = "";
  26. // Then we need to tell it which one we want in particular and store it for use in our code.
  27.                     $hp3_cont_lang_list = get_the_term_list( $term->ID, 'hp3_cont_lang', '<!-- <strong>This entry has content written in:</strong> --> ', ', ', '' );
  28.                     if ( '' != $hp3_cont_lang_list ) {
  29.                       $hp3_content_lang_text .= "$hp3_cont_lang_list\n";
  30.                     }
  31.     // Now we need to tell WordPress exactly how we want to display the tag
  32.                     if ( '' != $hp3_content_lang_text ) {
  33.                     ?>  
  34. <div class="entry-utility">  
  35. This entry is written in <?php echo $hp3_content_lang_text; echo $hp3_topic_lang_text; ?>.
  36. </div>  
  37. <!--// This just let's WordPress know that there's an else argument. It will remove the 'In this post' if no artists have been tagged.  -->
  38. <?  
  39.     }  
  40. ?>  
  41.  
  42.  
  43.  
  44.     <?php
  45. /** This is the End of my experiment*/
  46. ?>
  47.    
  48.         <?php
  49.             /* translators: used between list items, there is a space after the comma */
  50.             $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
  51.  
  52.             /* translators: used between list items, there is a space after the comma */
  53.             $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
  54.            
  55.            
  56.            
  57.             if ( '' != $tag_list ) {
  58.                 $utility_text = __( 'This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
  59.             } elseif ( '' != $categories_list ) {
  60.                 $utility_text = __( 'This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
  61.                
  62.                
  63.                
  64.             } else {
  65.                 $utility_text = __( 'This entry was posted by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
  66.             }
  67.  
  68.             printf(
  69.                 $utility_text,
  70.                 $categories_list,
  71.                 $tag_list,
  72.                 esc_url( get_permalink() ),
  73.                 the_title_attribute( 'echo=0' ),
  74.                 get_the_author(),
  75.                 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) )
  76.             );
  77.         ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement