Advertisement
Guest User

Untitled

a guest
Sep 17th, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.61 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @package Alizee
  4.  */
  5. ?>
  6.  
  7. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  8.  
  9. <?php
  10. function athemes_get_image_id($image_url) {
  11.     global $wpdb;
  12.     $attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url ));
  13.         return $attachment[0];
  14. }
  15. ?>
  16.  
  17. <?php if (function_exists('cfs') && ($cfs->get('gallery_images') != '') ) : ?>
  18.  
  19. <?php
  20.             $gallery_images = $cfs->get('gallery_images');
  21.                 echo '<div class="home-gallery">';
  22.                 echo '<ul class="slides">';
  23.                 foreach ($gallery_images as $gallery_image) {
  24.  
  25.                     $image_url      = $gallery_image['gallery_image'];
  26.                     $imageid        = athemes_get_image_id($image_url);
  27.                     $image_thumb    = wp_get_attachment_image_src($imageid, 'alizee-slider');
  28.  
  29.                     echo '<li><img src="' . $image_thumb[0] . '"></li>';
  30.                 }
  31.                 echo '</ul>';
  32.                 echo '</div>'; 
  33. ?>
  34. <?php endif; ?>
  35.    
  36. <?php if (( get_theme_mod('home_layout') == 'one_col' ) && ( has_post_thumbnail() )) : //check if we have a thumbnail, if not add a class to the content ?>
  37.     <div class="post-content">
  38. <?php else : ?>
  39.     <div class="post-content no-thumb">
  40. <?php endif; ?>
  41.         <header class="entry-header">
  42.             <?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?>
  43.  
  44.             <?php if ( 'post' == get_post_type() ) : ?>
  45.             <div class="entry-meta">
  46.                 <?php alizee_posted_on(); ?>
  47.             </div><!-- .entry-meta -->
  48.             <?php endif; ?>
  49.         </header><!-- .entry-header -->
  50.  
  51.         <div class="entry-summary">
  52.             <?php the_excerpt(); ?>
  53.         </div>
  54.     </div>
  55.  
  56. </article><!-- #post-## -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement