Want more features on Pastebin? Sign Up, it's FREE!
Guest

member.php

By: hrcwebmaster on Sep 29th, 2012  |  syntax: None  |  size: 6.44 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.  
  3. /**
  4. * Template Name: Member
  5. * The member template file.
  6. * This is the template file used for displaying member pages.
  7. * @package Catch Themes
  8. * @subpackage Catch_Box
  9. */
  10.  
  11. get_header(); ?>
  12.  
  13. </div><!-- site-logo -->
  14.  
  15. <div id="primary">
  16.  
  17. <div id="member-left">        
  18.  
  19.  
  20. <h1 class="member-title"><?php echo get_the_title($post->post_parent); ?></h1><br />
  21. <div style="text-align:center;"><?php $key="portrait"; echo get_post_meta($post->ID, $key, true); ?><br />
  22. <?php $key="district"; echo get_post_meta($post->ID, $key, true); ?> District<br />
  23. Position <?php $key="position"; echo get_post_meta($post->ID, $key, true); ?><br />
  24. <?php $key="hometown"; echo get_post_meta($post->ID, $key, true); ?><br />
  25. </div><!--centered section-->
  26.  
  27. <p></p>
  28. <h3 class="member-page-title">Committees:</h3>
  29. <?php $key="committees"; echo get_post_meta($post->ID, $key, true); ?><br />
  30. <p></p>
  31. <h3 class="member-page-title">Media Resources:</h3>
  32. <?php $key="pio"; echo get_post_meta($post->ID, $key, true); ?><br />
  33. <?php $key="broll"; echo get_post_meta($post->ID, $key, true); ?><br />
  34. <div class="spacer"></div>
  35. <div class="spacer"></div>
  36. <?php $key="flickr"; echo get_post_meta($post->ID, $key, true); ?><br />
  37.  
  38. </div><!-- #member-left -->
  39.  
  40.  
  41. <div id="member-content" role="main">
  42.  
  43. <?php if ( have_posts() ) : ?>
  44.  
  45.                                 <?php /* Start the Loop */ ?>
  46.                                 <?php while ( have_posts() ) : the_post(); ?>
  47.                                         <?php get_template_part( 'content', get_post_format() ); ?>
  48.  
  49.  
  50.                                 <?php endwhile; ?>
  51.  
  52.                                 <?php catchbox_content_nav( 'nav-below' ); ?>
  53.  
  54.                         <?php else : ?>
  55.  
  56.                                 <article id="post-0" class="post no-results not-found">
  57.                                         <header class="entry-header">
  58.                                                 <?php _e( 'Nothing Found', 'catchbox' ); ?>
  59.                                         </header><!-- .entry-header -->
  60.  
  61.                                         <div class="entry-content">
  62.                                                 <h1 class="entry-title"><p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'catchbox' ); ?></p></h1>
  63.                                                 <?php get_search_form(); ?>
  64.                                         </div><!-- .entry-content -->
  65.                                 </article><!-- #post-0 -->
  66.  
  67.                         <?php endif; ?>
  68.  
  69. <div class="address-footer">
  70. <?php $key = "oly-office"; echo get_post_meta($post->ID, $key, true); ?><br />
  71. <p></p>
  72. <?php if (get_post_meta( $post->ID, 'district-office', true )) : ?>
  73. <?php echo get_post_meta( $post->ID, 'district-office', true ) ?><br />
  74. <?php else : ?>
  75. <?php endif; ?>
  76. <br />
  77. </div>
  78.  
  79. </div><!-- #member-content -->
  80.  
  81. <div id="member-right">
  82.  
  83. <!-- RSS image and link to member's RSS feed -->
  84. <h3 class="member-page-title"><a href= "<?php $key="rss"; echo get_post_meta ($post->ID, $key, true); ?>">
  85. <img src="http://hrc.wastateleg.org/wp-content/uploads/RSSfeed24transparent.png" />
  86. </a>
  87.  
  88. <!-- Pull member's recent news-->
  89. <?php
  90.     $key = 'member-name';
  91.     $tag = get_post_meta($post->ID, $key, true);
  92.     $args=array(
  93.         'numberposts' =>5,
  94.         'tag' => $tag,
  95.         'orderby' =>'post_date',
  96.         'order' => 'DESC',
  97.     );
  98. $my_query = new WP_Query($args);
  99. $key = 'member-name';
  100. $tag = get_post_meta($post->ID, $key, true);
  101.  
  102.     if( $my_query->have_posts() ) {
  103.               echo 'Recent News:</h3>';
  104.       while ($my_query->have_posts()) : $my_query->the_post(); ?>
  105.         <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php
  106.  
  107. the_title_attribute(); ?>"><?php the_title(); ?></a></li>
  108.  
  109.        <?php
  110.       endwhile;
  111.     } //if ($my_query)
  112.   wp_reset_query();  // Restore global post data stomped by the_post().
  113. ?>
  114.  
  115. <!-- End pull member's recent news-->
  116.  
  117. <div class="spacer"></div>
  118.  
  119. <!-- RSS feed for Member in the News -->
  120. <h3 class="member-page-title"><?php echo get_the_title($post->post_parent); ?> In the News:</h3>
  121. <?php
  122. // Get RSS Feed(s)
  123. include_once(ABSPATH . WPINC . '/feed.php');
  124.  
  125. // Get a SimplePie feed object from the specified feed source.
  126. $rss = fetch_feed('<?php $key="delicious-feed"; echo get_post_meta($post->ID,$key,true); ?>');
  127. global $post;
  128. if (!is_wp_error( $rss ) ) :
  129. // Checks that the object is created correctly
  130.     // Figure out how many total items there are, but limit it to 5.
  131.     $maxitems = $rss->get_item_quantity(5);
  132.  
  133.    
  134. // Build an array of all the items, starting with element 0 (first element).
  135.     $rss_items = $rss->get_items(0, $maxitems);
  136. endif;
  137. ?>
  138.  
  139. <ul>
  140.     <?php if ($maxitems == 0) echo '<li>No items.</li>';
  141.     else
  142.    
  143. // Loop through each feed item and display each item as a hyperlink.
  144.     foreach ( $rss_items as $item ) : ?>
  145.     <li>
  146.         <a href='<?php echo esc_url( $item->get_permalink() ); ?>'
  147.         title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
  148.         <?php echo esc_html( $item->get_title() ); ?></a>
  149.     </li>
  150.     <?php endforeach; ?>
  151. </ul>
  152. <!-- End RSS feed for Member in the News -->
  153.  
  154. <p></p>
  155. <?php $key = "newsletter"; echo get_post_meta ($post->ID, $key, true); ?>
  156. <div class="spacer"></div>
  157. <?php if (get_post_meta( $post->ID, 'videos', true )) : ?>
  158. <?php echo '<h3 class="member-page-title">Watch:</h3>' ?>
  159. <?php echo get_post_meta( $post->ID, 'videos', true ) ?>
  160. <?php else : ?>
  161. <?php endif; ?>
  162. <div style="text-align:center;">
  163. <?php $key="youtube"; echo get_post_meta($post->ID, $key, true); ?>
  164. </div>
  165. <div class="spacer"></div>
  166.  
  167. <?php if (get_post_meta( $post->ID, 'audio-tag', true )) : ?>
  168. <h3 class="member-page-title"><a href="http://wahousegop.hipcast.com/rss/<?php $key="last-name"; echo get_post_meta($post->ID, $key, true); ?>.xml">
  169. <img src="http://hrc.wastateleg.org/wp-content/uploads/RSSfeed24transparent.png" />
  170. </a>
  171. <!-- Pull member's audio posts-->
  172. <?php
  173.     $key = 'audio-tag';
  174.     $tag = get_post_meta($post->ID, $key, true);
  175.     $args=array(
  176.         'numberposts' =>3,
  177.         'tag' => $tag,
  178.         'orderby' =>'post_date',
  179.         'order' => 'DESC',
  180.     );
  181. $my_query = new WP_Query($args);
  182. $key = 'audio-tag';
  183. $tag = get_post_meta($post->ID, $key, true);
  184.  
  185.     if( $my_query->have_posts() ) {
  186.               echo 'Listen:</h3>';
  187.       while ($my_query->have_posts()) : $my_query->the_post(); ?>
  188.         <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php
  189.  
  190. the_title_attribute(); ?>"><?php the_title(); ?></a></li>
  191.  
  192.        <?php
  193.       endwhile;
  194.     } //if ($my_query)
  195.   wp_reset_query();  // Restore global post data stomped by the_post().
  196. ?>
  197.  
  198. <!-- Extra code to close loop on checking if there is any audio-->
  199.  
  200. <?php else : ?>
  201.  
  202. <?php endif; ?>
  203.  
  204. <!-- End pull member's audio posts-->
  205.  
  206. </div><!-- #member-right -->
  207.                
  208. </div><!-- #primary -->
  209.  
  210. <?php get_footer(); ?>
clone this paste RAW Paste Data