Advertisement
Guest User

single-portfolio.php

a guest
Dec 8th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.56 KB | None | 0 0
  1. <?php
  2. // File Security Check
  3. if ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) && basename( __FILE__ ) == basename( $_SERVER['SCRIPT_FILENAME'] ) ) :
  4.     die ( 'You do not have sufficient permissions to access this page!' );
  5. endif;
  6.  
  7. get_header(); ?>
  8.  
  9. <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  10.  
  11.             <h1><?php the_title(); ?></h1>
  12.  
  13.             <h4><?php echo get_the_term_list( get_the_ID(), 'portfolio-category', '<span class="portfolio-categories">' . __( 'Filed Under', 'nicethemes' ) . ': ', ', ', '</span><!--/.portfolio-categories-->' . "\n" ); ?></h4>
  14.  
  15.             <?php
  16.  
  17.             $embed = get_post_meta( get_the_ID(), 'embed', true );
  18.  
  19.             $attachments = get_children( array( 'post_parent'       => get_the_ID(),
  20.                                                 'post_type'         => 'attachment',
  21.                                                 'post_mime_type'    => 'image',
  22.                                                 'order'             => 'DESC',
  23.                                                 'orderby'           => 'menu_order date')
  24.                                             );
  25.  
  26.             if ( has_post_thumbnail() || ! empty( $attachments ) || ( $embed <> '' ) ) { ?>
  27.  
  28.                 <div class="featured-image clearfix">
  29.  
  30.                 <?php
  31.  
  32.                 if ( $embed <> '' ) {
  33.  
  34.                     echo nice_embed( array ( 'id' => get_the_ID(), 'width' => 620 ) );
  35.  
  36.                 } elseif ( ! empty( $attachments ) && ( count( $attachments ) > 1) ) {
  37.  
  38.                     ?>
  39.                     <div style="width:630px; margin:0 auto; position:relative;" class="clearfix">
  40.  
  41.                     <div id="slides" data-speed="12000" data-loader="<?php echo get_template_directory_uri(); ?>/images/ajax-loader.gif" class="slider clearfix">
  42.  
  43.                         <!-- BEGIN .slides_container -->
  44.                         <div class="slides_container">
  45.                         <?php foreach ( $attachments as $att_id => $attachment ) { ?>
  46.                             <div class="slide">
  47.                                 <?php nice_image( array( 'width' => 620, 'height' => 265, 'class' => 'wp-post-image', 'id' =>  $att_id ) ); ?>
  48.                             </div>
  49.                         <?
  50.                         } // endforeach
  51.                         ?>
  52.  
  53.                         <!-- END .slides_container -->
  54.                         </div>
  55.  
  56.                     <!-- END #slides -->
  57.                     </div>
  58.  
  59.                 <?php
  60.                 } elseif ( ! empty( $attachments ) || has_post_thumbnail() ){
  61.                     nice_image( array( 'width' => 620, 'height' => 265, 'class' => 'wp-post-image' ) );
  62.                 }
  63.                 ?>
  64.                 </div>
  65.                 </div>
  66.             <?php
  67.             }
  68.  
  69.             ?>
  70.             <div id="content" <?php post_class(); ?>>
  71.             <div class="post">
  72.             <?php the_content(); ?>
  73.             <?php
  74.  
  75.  
  76.             $testimonial = get_post_meta( get_the_ID(), 'testimonial', true );
  77.             $testimonial_author = get_post_meta( get_the_ID(), 'testimonial_author', true );
  78.             $url = get_post_meta( get_the_ID(), 'url', true);
  79.  
  80.             echo '<div>' . "\n";
  81.  
  82.             if ( $testimonial != '' ) { echo '<blockquote>' . $testimonial . "\n"; } // End IF Statement
  83.  
  84.             if ( $testimonial_author != '' ) {
  85.                 echo '<cite>' . $testimonial_author . "\n";
  86.                     if ( $url != '' ) { echo ' &mdash; <a href="' . $url . '">' . $url . '</a>' . "\n"; }
  87.                 echo '</cite>' . "\n";
  88.             } // End IF Statement
  89.  
  90.             if ( $testimonial != '' ) { echo '</blockquote>' . "\n"; }
  91.  
  92.             echo '</div><!--/#extras-->' . "\n";
  93.  
  94.             ?>
  95.  
  96.             <div class="post-entries">
  97.                 <div class="nav-prev fl"><?php previous_post_link( '%link', '<span class="meta-nav">&larr;</span> ' . __( 'Previous', 'nicethemes' ) ); ?></div>
  98.                 <div class="nav-next fr"><?php next_post_link( '%link', __( 'Next', 'nicethemes' ) . ' <span class="meta-nav">&rarr;</span>' ); ?></div>
  99.                 <div class="fix"></div>
  100.             </div><!-- #post-entries -->
  101.  
  102.         </div>
  103.  
  104.             <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'nicethemes' ), 'after' => '</div>' ) ); ?>
  105.  
  106. </div>
  107. <!-- END #content -->
  108. <?php endwhile; // end of the loop. ?>
  109.  
  110.  
  111. <hr class="hidden" />
  112.  
  113. <?php get_sidebar(); ?>
  114.  
  115. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement