Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * This is the template file for single posts. It is used by single posts of any post type.
- *
- */
- get_header();
- ?>
- <div id="main-col">
- <?php suffusion_before_begin_content(); ?>
- <div id="content">
- <?php
- global $post, $suffusion_is_cpt;
- if ($post->post_type != 'post') {
- $suffusion_is_cpt = true;
- add_filter('suffusion_byline_position', 'suffusion_single_cpt_byline_position');
- add_action('suffusion_add_taxonomy_bylines_line', 'suffusion_cpt_line_taxonomies', 10, 2);
- add_action('suffusion_add_taxonomy_bylines_pullout', 'suffusion_cpt_line_taxonomies', 10, 4);
- global $suffusion_cpt_layouts, $suf_cpt_bylines_posted_by, $suf_cpt_bylines_comments, $suf_cpt_bylines_permalinks, $suf_cpt_bylines_post_date;
- if (isset($suffusion_cpt_layouts[$post->post_type]) && isset($suffusion_cpt_layouts[$post->post_type]['byline-contents'])) {
- $byline_contents = explode(',', $suffusion_cpt_layouts[$post->post_type]['byline-contents']);
- $suf_cpt_bylines_posted_by = in_array('posted-by', $byline_contents) ? 'show' : 'hide';
- $suf_cpt_bylines_comments = in_array('comments', $byline_contents) ? 'show' : 'hide';
- $suf_cpt_bylines_permalinks = in_array('permalink', $byline_contents) ? 'show' : 'hide';
- $suf_cpt_bylines_post_date = in_array('date', $byline_contents) ? 'show' : 'hide';
- }
- else {
- $suf_cpt_bylines_posted_by = false;
- $suf_cpt_bylines_comments = false;
- $suf_cpt_bylines_permalinks = false;
- $suf_cpt_bylines_post_date = false;
- }
- }
- if (have_posts()) {
- while (have_posts()) {
- the_post();
- global $suf_prev_next_above_below;
- if ($suf_prev_next_above_below == 'above' || $suf_prev_next_above_below == 'above-below') {
- get_template_part('custom/prev-next');
- }
- $original_post = $post;
- do_action('suffusion_before_post', $post->ID, 'blog', 1);
- ?>
- <article <?php post_class();?> id="post-<?php the_ID(); ?>">
- <?php
- suffusion_after_begin_post();
- echo '<div class="cs_blue cs_widget" style="font-weight: 600">Study details</div>';
- ?>
- <div class="entry-container fix">
- <div class="entry fix">
- <?php
- suffusion_content();
- echo '<div style="display:none">'.$post->ID.'</div>';
- $study_id = $post->ID;
- $t = get_post_meta($study_id, 'study_image', true);
- if ($t == 0) {
- $t = 1046;
- }
- ?>
- <div class="cs_detail_image">
- <?php
- echo wp_get_attachment_image($t)."<br>";
- $t = get_post_meta($study_id, 'about', true);
- if (strlen($t)>= 1 ){
- edit_post_link(__('Edit'),'','',$study_id);
- }
- ?>
- </div>
- <?php
- $t = get_post_meta($study_id, 'about', true);
- if (strlen($t)>= 1 ){
- echo '<div class="cs_detail_header">About the study: </div><div class="cs_detail_content">'. $t.'</div>';
- }
- $t = get_post_meta($study_id, 'variants', true);
- if (strlen($t)>= 1 ){
- echo '<div class="cs_detail_header">Variant names: </div><div class="cs_detail_content">'. $t .'</div>';
- }
- $t = get_post_meta($study_id, 'origin', true);
- if (strlen($t)>= 1 ){
- echo '<div class="cs_detail_header">Name Origin: </div><div class="cs_detail_content">'. $t .'</div>';
- }
- $t = get_post_meta($study_id, 'history', true);
- if (strlen($t)>= 1 ){
- echo '<div class="cs_detail_header">History of the name: </div><div class="cs_detail_content">'. $t .'</div>';
- }
- $t = get_post_meta($study_id, 'frequency', true);
- if (strlen($t)>= 1 ){
- echo '<div class="cs_detail_header">Name frequency: </div><div class="cs_detail_content">'. $t .'</div>';
- }
- $t = get_post_meta($study_id, 'distribution', true);
- if (strlen($t)>= 1 ){
- echo '<div class="cs_detail_header">Distribution of the name: </div><div class="cs_detail_content">'. $t .'</div>';
- }
- $t = get_post_meta($study_id, 'data', true);
- if (strlen($t)>= 1 ){
- echo '<div class="cs_detail_header">Data: </div><div class="cs_detail_content">'. $t .'</div>';
- }
- $t = get_post_meta($study_id, 'dna', true);
- if (strlen($t)>= 1 ){
- echo '<div class="cs_detail_header">DNA: </div><div class="cs_detail_content">'. $t .'</div>';
- }
- $t = get_post_meta($study_id, 'links', true);
- if (strlen($t)>= 1 ){
- echo '<div class="cs_detail_header">Links: </div><div class="cs_detail_content">'. $t.'</div>';
- }
- $unam = get_the_author_meta ('display_name', $post->post_author );
- echo '<div style="display:none;">Name: '.$unam.'</div>';
- $unum = get_the_author_meta ('user_email', $post->post_author );
- echo '<div style="display:none;">Name: '.$unum.'</div>';
- echo '<div class="cs_detail_header">Contact: </div><div class="cs_detail_content">'.$unam.'</div>';
- if ($unum =="[email protected]"){
- $unum = "none";
- echo '<div class="cs_detail_header">Email: </div><div class="cs_detail_content">No Email</div>';
- }
- else {
- echo '<div class="cs_detail_header">Email: </div><div class="cs_detail_content"><a href="mailto:"'.$unum.'>'.$unum.'</a></div>';
- }
- //Last modified
- $modd = get_the_modified_date();
- echo '<div class="cs_detail_header" style="font-size:0.7em;">Last updated: </div>';
- echo '<div class="cs_detail_content" style="font-size:0.7em;">'.$modd.'</div>';
- //Page views
- echo '<div class="cs_detail_header" style="font-size:0.7em;">This page has been visited: </div>';
- $views = wpp_get_views( get_the_ID() );
- echo '<div class="cs_detail_content" style="font-size:0.7em;">'.$views.' since 1st July 2014.</div>';
- ?>
- </div><!--/entry -->
- <?php
- // Due to the inclusion of Ad Hoc Widgets the global variable $post might have got changed. We will reset it to the original value.
- $post = $original_post;
- suffusion_after_content();
- ?>
- </div><!-- .entry-container -->
- <?php
- suffusion_before_end_post();
- comments_template();
- ?>
- </article><!--/post -->
- <?php
- do_action('suffusion_after_post', $post->ID, 'blog', 1);
- /*if ($suf_prev_next_above_below == 'below' || $suf_prev_next_above_below == 'above-below') {
- get_template_part('custom/prev-next');
- }*/
- }
- }
- else {
- ?>
- <article class="post fix">
- <p><?php _e('Sorry, this name is not registered as a study.', 'suffusion'); ?></p>
- </article><!--post -->
- <?php
- }
- ?>
- </div><!-- content -->
- </div><!-- main col -->
- <?php
- get_footer();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment