Esempio n. 1
0
"><?php 
        the_title();
        ?>
</a></h2>
						<?php 
        nice_post_meta();
        ?>
	                </header>

	                <?php 
        if (has_post_thumbnail()) {
            ?>

		            	<figure class="featured-image">
							<?php 
            nice_image(array('width' => 620, 'height' => 285, 'class' => 'wp-post-image'));
            ?>
		                </figure>

					<?php 
        }
        ?>

					<?php 
        nice_excerpt();
        ?>

                </article>

		<?php 
    }
					                </li>

					            <?php 
                }
                ?>

							</ul>
						</div>

					<?php 
            } else {
                ?>

						<figure class="featured-image">
							<?php 
                nice_image(array('width' => 730, 'class' => 'wp-post-image'));
                ?>
						</figure>

					<?php 
            }
            ?>

				<?php 
        }
        ?>


	            </article>

	</div>
			<div class="entry">

				<?php

				$embed = get_post_meta( get_the_ID(), 'embed', true );
				$video_class = '';

				if ( $embed <> '' ){
					echo nice_embed( array ( 'id' => get_the_ID() ) );
					$video_class = ' has-video';
				}
				elseif ( has_post_thumbnail() ) { ?>

					<figure class="featured-image">
						<?php nice_image( array( 'width' => 730, 'height' => 338, 'class' => 'wp-post-image' ) ); ?>
					</figure>

				<?php } ?>

					<div class="post-content<?php echo $video_class; ?>">
						<?php the_content(); ?>

						<div class="paths">

						<?php include 'parts/features_loop.php'; ?>
						
						</div>

					</div>
Esempio n. 4
0
		<!-- BEGIN .flexslider -->
		<div class="flexslider slider">

	    	<ul class="slides">

	            <?php 
        foreach ($slides as $post) {
            setup_postdata($post);
            ?>
					<li>
	                    <?php 
            if (get_post_meta($post->ID, 'embed', $single = true)) {
                nice_embed(array('key' => 'embed', 'width' => 960, 'height' => 400, 'wrap' => true, 'embed_id' => 'player_' . $post->ID)) . "\n";
            } elseif (has_post_thumbnail()) {
                nice_image(array('key' => 'slider-image', 'width' => 956, 'height' => 400)) . "\n";
                if ($nice_options['nice_slider_caption'] == 'true') {
                    $slide_description = get_post_meta($post->ID, 'slide-description', true);
                    ?>

										<div class="flex-caption">
				                        	<h2><?php 
                    the_title();
                    ?>
</h2>
				                        	<?php 
                    if ($slide_description != '') {
                        ?>
<p><?php 
                        echo $slide_description;
                        ?>
                            echo '<span class="price">' . $currency . $price . '</span>' . "\n";
                        }
                        echo '</div><div class="description clearfix">' . "\n";
                        if (has_post_thumbnail() && nice_bool(get_post_meta($post->ID, 'display_image_menu', true))) {
                            ?>

					            	<figure class="featured-image fl">
					            		<a href="<?php 
                            the_permalink();
                            ?>
" title="<?php 
                            printf(__('Permanent Link to %s', 'nicethemes'), get_the_title());
                            ?>
">
											<?php 
                            nice_image('width=85&height=65&class=menu-image fl');
                            ?>
					            		</a>
					                </figure>

								<?php 
                        }
                        if (get_the_excerpt() != '') {
                            echo '' . get_the_excerpt() . '' . "\n";
                        }
                        echo '</div></li>' . "\n";
                    }
                    echo '</ul>' . "\n";
                }
                echo '</div>' . "\n";
                wp_reset_query();
 function nice_display_feedback_items($args = '')
 {
     $defaults = array('post_type' => 'feedback', 'no_found_rows' => true, 'numberposts' => 5, 'orderby' => 'rand', 'order' => 'DESC', 'id' => 0, 'display_author' => true, 'display_url' => true, 'effect' => 'fade', 'pagination' => false, 'echo' => true);
     $args = wp_parse_args($args, $defaults);
     $output = '';
     $items = get_posts($args);
     // display items
     if (!is_wp_error($items) && is_array($items) && count($items) > 0) {
         $effect = '';
         if ($args['effect'] != 'none') {
             $effect = ' ' . $args['effect'];
         }
         $output .= '<div class="feedback' . $effect . '">' . "\n";
         $output .= '<div class="feedback-list">' . "\n";
         foreach ($items as $post) {
             setup_postdata($post);
             $feedback_author = '';
             // If we need to display either the author, URL or both, get the data.
             if ($args['display_author'] == true || $args['display_url'] == true) {
                 $meta = get_post_custom($post->ID);
                 if (isset($meta['feedback_author']) && $meta['feedback_author'][0] != '' && $args['display_author'] == true) {
                     $feedback_author .= '<cite class="feedback-author">' . $meta['feedback_author'][0] . '</cite>' . "\n";
                 }
                 if (isset($meta['feedback_url']) && $meta['feedback_url'][0] != '' && $args['display_url'] == true) {
                     $feedback_author .= ' &mdash; <a href="' . $meta['feedback_url'][0] . '" title="' . esc_attr($meta['feedback_author'][0]) . '" class="feedback-url">' . $meta['feedback_url'][0] . '</a>';
                 }
             }
             $img_class = '';
             $output .= '<div id="quote-' . $post->ID . '" class="quote">' . "\n";
             if ($args['featured_image'] > 0) {
                 $img = nice_image('echo=0&height=' . $args['featured_image'] . '&width=' . $args['featured_image'] . '&class=thumbnail&single=true&id=' . $post->ID);
                 if ($img) {
                     $output .= '<div class="thumb alignleft">' . $img . '</div>';
                 } else {
                     $img_class = ' no-img';
                 }
             } else {
                 $img_class = ' no-img';
             }
             $output .= '<blockquote class="feedback-text' . $img_class . '">' . get_the_content() . '</blockquote>' . "\n";
             $output .= $feedback_author;
             $output .= '</div>' . "\n";
             wp_reset_postdata();
         }
         $output .= '</div>' . "\n";
         if ($args['pagination'] == true && count($items) > 1 && $args['effect'] != 'none') {
             $output .= '<div class="pagination">' . "\n";
             $output .= '<a href="#" class="btn-prev">&larr; ' . __('Previous', 'nicethemes') . '</a>' . "\n";
             $output .= '<a href="#" class="btn-next">' . __('Next', 'nicethemes') . ' &rarr;</a>' . "\n";
             $output .= '</div>' . "\n";
         }
         $output .= '</div>' . "\n";
     }
     if ($args['echo'] != true) {
         return $output;
     }
     // Should only run is "echo" is set to true.
     echo $output;
     wp_reset_query();
 }
									<?php 
                $src = get_nice_image_path($att_id);
                ?>

									<li>
										<figure class="thumb">
											<a class="fancybox" rel="group" href="<?php 
                echo wp_get_attachment_url($att_id);
                ?>
" title="<?php 
                echo get_the_title($att_id);
                ?>
">
						                    <?php 
                nice_image(array('width' => 375, 'height' => 250, 'class' => 'wp-post-image', 'src' => $src));
                ?>
											</a>
										</figure>
					                </li>

					            <?php 
            }
            ?>

							</ul>

						</div>

				<?php 
        } else {
    function nice_tabs_recent($posts = 5, $size = 45)
    {
        global $post;
        $args = array('no_found_rows' => true, 'ignore_sticky_posts' => 1, 'posts_per_page' => $posts, 'orderby' => 'post_date', 'order' => 'desc');
        $r = get_posts($args);
        foreach ($r as $post) {
            setup_postdata($post);
            ?>
	<li class="clearfix">
		<?php 
            if ($size != 0) {
                nice_image('height=' . $size . '&width=' . $size . '&class=thumbnail&single=true');
            }
            ?>
		<a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            echo esc_attr(get_the_title() ? get_the_title() : get_the_ID());
            ?>
"><?php 
            if (get_the_title()) {
                the_title();
            } else {
                the_ID();
            }
            ?>
</a>
		<span class="meta"><?php 
            the_time(get_option('date_format'));
            ?>
</span>
	</li>
	<?php 
        }
        wp_reset_postdata();
    }
Esempio n. 9
0
 /**
  * nicethemes_gallery()
  *
  * Create a list of articles, by category, within a grid.
  *
  * @since 1.0.0
  *
  */
 function nicethemes_gallery($args = array())
 {
     global $post;
     $defaults = apply_filters('nicethemes_gallery_default_args', array('ids' => null, 'columns' => 3, 'rows' => false, 'numberposts' => -1, 'orderby' => 'menu_order', 'echo' => true, 'order' => 'ASC', 'width' => 480, 'height' => 480, 'before' => '', 'after' => ''));
     $args = wp_parse_args($args, $defaults);
     $args = apply_filters('nicethemes_gallery_args', $args);
     do_action('nicethemes_gallery_before', $args);
     $output = '';
     if (!empty($args['ids'])) {
         // we get the ids parameter containing the list of images
         // Set the list in an array
         $ids = array();
         $attachment_ids = explode(',', $args['ids']);
         $ids = array_merge($ids, $attachment_ids);
         $attachments = array_flip($ids);
     } else {
         // get the images from the media uploaded to the page/post/cpt
         $attachments = get_children(array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $args['order'], 'numberposts' => $args['numberposts'], 'orderby' => $args['orderby']));
         if (empty($attachments)) {
             // if the gallery shortcode is used, we get the images from that
             $attachments = nice_attachments_from_gallery();
         }
     }
     if (!empty($attachments) && count($attachments) > 1) {
         // begin parsing the images, creating the gallery
         $output .= $args['before'] . "\n";
         // The template for each gallery item
         $tpl = '<div class="%%CLASS%%"><figure class="thumb">%%IMAGE%%</figure></div>';
         $tpl = apply_filters('nicethemes_gallery_item_template', $tpl, $args);
         $loop = 0;
         $output .= '<div class="nice-gallery grid">' . "\n";
         foreach ($attachments as $att_id => $attachment) {
             $loop++;
             $template = $tpl;
             $class = 'item columns-' . esc_attr(intval($args['columns']));
             if ($loop % $args['columns'] == 0) {
                 $class .= ' last';
             }
             if (($loop - 1) % $args['columns'] == 0) {
                 $class .= ' first';
                 if ($args['rows']) {
                     $output .= '<div class="row">' . "\n";
                 }
             }
             $template = str_replace('%%CLASS%%', $class, $template);
             $image = '<a class="fancybox" rel="group" href="' . wp_get_attachment_url($att_id) . '" title="' . get_the_title($att_id) . '">';
             $image_size = apply_filters('nicethemes_gallery_image_size', array($args['width'], $args['height']));
             if (function_exists('nice_image')) {
                 $image .= nice_image(array('width' => $args['width'], 'height' => $args['height'], 'id' => $att_id, 'echo' => false));
             } else {
                 $image .= get_the_post_thumbnail($att_id, $image_size);
             }
             $image .= '<div class="mask"></div></a>';
             $template = str_replace('%%IMAGE%%', $image, $template);
             // $post ??
             $template = apply_filters('nicethemes_gallery_template', $template, $post);
             $output .= $template;
             if ($loop % $args['columns'] == 0 && $args['rows']) {
                 $output .= '</div>';
             }
         }
         if ($loop % $args['columns'] != 0 && $args['rows']) {
             $output .= '</div>';
         }
         $output .= '</div>';
         $output .= $args['after'] . "\n";
     } else {
         $output .= __('There are no images for this gallery', 'nicethemes');
     }
     $output = apply_filters('nicethemes_gallery_html', $output, $attachments, $args);
     if ($args['echo'] == true) {
         echo $output;
     } else {
         return $output;
     }
     do_action('nicethemes_gallery_after', $args);
 }
				$columns = 3;
				$loop = 0;

				while ( have_posts() ) : the_post();

				$loop++;
				?>
				<div id="post-<?php the_ID(); ?>" class="masonry-item isotope-item columns-<?php echo $columns; ?> <?php if ( $loop % $columns == 0) echo 'last'; if ( ( $loop - 1 ) % $columns == 0 ) echo 'first'; ?>">

					<!-- BEGIN .post -->
					<article class="post clearfix">

						<?php if ( has_post_thumbnail() ) :	?>
							<figure class="featured-image view view-more">
									<a href="<?php the_permalink(); ?>" title="<?php printf( __( 'Permanent Link to %s', 'nicethemes' ), get_the_title() ); ?>">
										<?php nice_image( array( 'width' => 580, 'height' => 405, 'class' => 'wp-post-image' ) ); ?>
									</a>
							</figure>
						<?php endif; ?>

						<header>
							<h2 class="post-title">
								<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf( __( 'Permanent Link to %s', 'nicethemes' ), get_the_title() ); ?>"><?php the_title(); ?></a>
							</h2>
							<?php nice_post_meta_masonry(); ?>
						</header>

						<div class="entry">

							<div class="post-content">
								<?php the_excerpt(); ?>
                echo '<span class="price">' . $currency . $price . '</span>' . "\n";
            }
            echo '</div><div class="description clearfix">';
            if (has_post_thumbnail() && nice_bool(get_post_meta($post->ID, 'display_image_menu_list', true))) {
                ?>

				            	<figure class="featured-image fl">
				            		<a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                printf(__('Permanent Link to %s', 'nicethemes'), get_the_title());
                ?>
">
										<?php 
                nice_image(array('width' => 120, 'height' => 80, 'class' => 'menu-image fl'));
                ?>
				            		</a>
				                </figure>

							<?php 
            }
            if (get_the_excerpt() != '') {
                echo '' . get_the_excerpt() . '';
            }
            echo '</div></li>';
        }
        echo '</ul>';
        if (nice_bool($taxonomy_menu_grid)) {
            echo '</div>';
        }
                                    echo '<span class="price">' . $currency . $price . '</span>' . "\n";
                                }
                                echo '</div><div class="description clearfix">' . "\n";
                                if (has_post_thumbnail() && nice_bool(get_post_meta($post->ID, 'display_image_menu_list', true))) {
                                    ?>

							            	<figure class="featured-image fl">
							            		<a href="<?php 
                                    the_permalink();
                                    ?>
" title="<?php 
                                    printf(__('Permanent Link to %s', 'nicethemes'), get_the_title());
                                    ?>
">
													<?php 
                                    nice_image('width=120&height=80&class=menu-image fl');
                                    ?>
							            		</a>
							                </figure>

										<?php 
                                }
                                if (get_the_excerpt() != '') {
                                    echo '' . get_the_excerpt() . '' . "\n";
                                }
                                echo '</div></li>' . "\n";
                            }
                            echo '</ul>' . "\n";
                        }
                    }
                }