当前位置: 首页>>代码示例>>PHP>>正文


PHP get_post_gallery_images函数代码示例

本文整理汇总了PHP中get_post_gallery_images函数的典型用法代码示例。如果您正苦于以下问题:PHP get_post_gallery_images函数的具体用法?PHP get_post_gallery_images怎么用?PHP get_post_gallery_images使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_post_gallery_images函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: determine_card_type

 /**
  * Determines the twitter card type for the current page
  */
 private function determine_card_type()
 {
     $this->type = $this->options['twitter_card_type'];
     if (is_singular() && has_shortcode($GLOBALS['post']->post_content, 'gallery')) {
         $this->images = get_post_gallery_images();
         if (count($this->images) > 0) {
             $this->type = 'summary_large_image';
         }
     }
     /**
      * Filter: 'wpseo_twitter_card_type' - Allow changing the Twitter Card type as output in the Twitter card by Yoast SEO
      *
      * @api string $unsigned The type string
      */
     $this->type = apply_filters('wpseo_twitter_card_type', $this->type);
 }
开发者ID:healthcommcore,项目名称:osnap,代码行数:19,代码来源:class-twitter.php

示例2: determine_card_type

 /**
  * Determines the twitter card type for the current page
  */
 private function determine_card_type()
 {
     $this->type = $this->options['twitter_card_type'];
     if (is_singular()) {
         // If the current post has a gallery, output a gallery card
         if (has_shortcode($GLOBALS['post']->post_content, 'gallery')) {
             $this->images = get_post_gallery_images();
             if (count($this->images) > 3) {
                 $this->type = 'gallery';
             }
         }
     }
     /**
      * Filter: 'wpseo_twitter_card_type' - Allow changing the Twitter Card type as output in the Twitter card by WP SEO
      *
      * @api string $unsigned The type string
      */
     $this->type = apply_filters('wpseo_twitter_card_type', $this->type);
 }
开发者ID:HealthStaffTraining,项目名称:healthstafftraining,代码行数:22,代码来源:class-twitter.php

示例3: widget

    /**
     * Outputs the HTML for this widget.
     *
     * @param array  An array of standard parameters for widgets in this theme
     * @param array  An array of settings for this widget instance
     * @return void Echoes it's output
     **/
    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
        $fetch = empty($instance['fetch']) ? ' ' : apply_filters('widget_title', $instance['fetch']);
        echo $before_widget;
        echo $before_title;
        echo $title;
        // Can set this with a widget option, or omit altogether
        echo $after_title;
        //
        // Widget display logic goes here
        //
        /*oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo*/
        /* Here We Go, BUild the Gate to prevent headache to find out which the Output*/
        /*oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo*/
        ?>
    <div class="row albwidget">
    <?php 
        global $wp_query;
        $args = array('post_type' => 'zl_album', 'post_status' => 'publish', 'orderby' => 'DATE', 'order' => 'DESC', 'posts_per_page' => $fetch, 'ignore_sticky_posts' => 1);
        $album = new WP_Query($args);
        ?>
    <?php 
        if ($album->have_posts()) {
            while ($album->have_posts()) {
                $album->the_post();
                //Let's Generate the Thumbnail.
                $thumb = get_post_thumbnail_id();
                $img_url = wp_get_attachment_url($thumb, 'full');
                $image = zl_theme_thumb($img_url, 100, 100, 'c', true);
                //Get Gallery Images
                $gallery = get_post_gallery_images();
                //Count Images
                $items = count($gallery);
                //Get the First Item if featured image isn't set.
                $firstimg = reset($gallery);
                $firstimg = str_replace('-150x150', '', $firstimg);
                //Crop the first image.
                $firstimg = zl_theme_thumb($firstimg, 100, 100, 'c', true);
                ?>
        <!-- Album Loop -->
        <div class="small-4 column tooltip" title="<?php 
                the_title();
                ?>
 | <?php 
                echo $items . zl_option('lang_photos', __(' Photos', 'zatolab'));
                ?>
">
            <div class="zl_alb_wid" title="<?php 
                the_title();
                ?>
 | <?php 
                echo $items . zl_option('lang_photos', __(' Photos', 'zatolab'));
                ?>
">
                <div data-albumlink='<?php 
                the_permalink();
                ?>
' data-albumid="album-<?php 
                the_ID();
                ?>
">
                    <a href="<?php 
                the_permalink();
                ?>
" class="abs">&nbsp;</a>
                    <a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title();
                ?>
">
                    <?php 
                if ($image) {
                    echo '<img src="' . $image . '" alt="' . get_the_title() . '" />';
                } else {
                    echo '<img src="' . $firstimg . '" alt="' . get_the_title() . '" />';
                }
                ?>
                    </a>
                </div>
            </div>
        </div><!-- // .zl_album_parent large-3 Album Loop -->
    <?php 
            }
        }
        ?>
    </div>
<?php 
        /*oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo*/
        /* </END of: Here We Go, BUild the Gate to prevent headache to find out which the Output*>
//.........这里部分代码省略.........
开发者ID:webtechfreaky,项目名称:vienna-content-focused-personal-blog-theme,代码行数:101,代码来源:recentalbums.php

示例4: while

				<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
				
					<?php 
        the_content();
        ?>
					
					<div class="imagegal photos">
						
						<ul>
							
							 <?php 
        $gallery = get_post_gallery_images($post->ID);
        foreach ($gallery as $image) {
            // Loop through each image in each gallery
            $image_list .= '<li><a rel="prettyPhoto[gal]" href=" ' . str_replace('-150x150', '', $image) . ' "><img src="' . str_replace('-150x150', '', $image) . '"  /></li></a>';
        }
        echo $image_list;
        ?>
								
								<div class="clear"></div>
						</ul>
						
					<div class="clear"></div>
					</div>
				
				
				<?php 
开发者ID:Vinnica,项目名称:theboxerboston.com,代码行数:31,代码来源:page_gallery.php

示例5: gallery_images_output

 /**
  * Outputs the first 4 images of a gallery as the posts gallery images
  */
 private function gallery_images_output()
 {
     $images = get_post_gallery_images();
     // If there are no images attached, use the standard single image output
     if (count($images) === 0) {
         $this->single_image_output();
         return;
     }
     $image_counter = 0;
     foreach ($images as $image) {
         if ($image_counter > 3) {
             return;
         }
         $this->image_output($image, 'image' . $image_counter);
         $image_counter++;
     }
 }
开发者ID:aim-web-projects,项目名称:kobe-chuoh,代码行数:20,代码来源:class-twitter.php

示例6: get_post_gallery_images

            mode: 'fade',
            speed: 1500,
            auto: true,
            pause: 3000,
            adaptiveHeight: true,
            nextText: '',
            prevText: '',
            nextSelector: '.slide-next',
            prevSelector: '.slide-prev',
            pager: false
         });
      });
   </script>
   <div class="gallery-post-format">
      <?php 
    $galleries = get_post_gallery_images($post);
    $output = '<ul class="gallery-images">';
    foreach ($galleries as $gallery) {
        $output .= '<li>' . '<img src="' . $gallery . '">' . '</li>';
    }
    $output .= '</ul>';
    echo $output;
    ?>
   </div>
<?php 
}
if (has_post_format('video')) {
    ?>
   <?php 
    $video_post_url = get_post_meta($post->ID, 'video_url', true);
    ?>
开发者ID:caduol,项目名称:musica,代码行数:31,代码来源:post-formats.php

示例7: get_the_post_thumbnail

			<div class="fes-product equal">

				<?php 
        if (has_post_thumbnail($product->ID)) {
            ?>
					<div class="fes-product-image">
						<?php 
            echo get_the_post_thumbnail($product->ID, 'portfolio-thumb');
            ?>
					</div>

				<?php 
        } else {
            if (has_shortcode($product->post_content, 'gallery')) {
                // Grab the first image from the gallery if we have one
                $gallery = get_post_gallery_images($product->ID);
                $image_list = '<div class="fes-product-image">';
                // Grab only the first image from the gallery
                $i = 0;
                foreach ($gallery as $image) {
                    if (++$i > 1) {
                        break;
                    }
                    $image_list .= '<div><img src=" ' . $image . ' " /></div>';
                }
                $image_list .= '</div>';
                // Display gallery image
                echo $image_list;
            }
        }
        ?>
开发者ID:qhuit,项目名称:UrbanPekor,代码行数:31,代码来源:frontend-products.php

示例8: hocwp_post_thumbnail_large_if_not_default

function hocwp_post_thumbnail_large_if_not_default($result, $post_id)
{
    if (empty($result)) {
        $result = get_post_meta($post_id, 'large_thumbnail', true);
        $result = hocwp_sanitize_media_value($result);
        $result = $result['url'];
        if (empty($result)) {
            $gallery = get_post_gallery_images($post_id);
            if (hocwp_array_has_value($gallery)) {
                $result = array_shift($gallery);
            }
        }
    }
    return $result;
}
开发者ID:skylarkcob,项目名称:hocwp-projects,代码行数:15,代码来源:post.php

示例9: carousel_shortcode

function carousel_shortcode($atts)
{
    extract(shortcode_atts(array('slug' => 'home-page-vendors', 'category' => 'carousel'), $atts));
    $carouselBlock = '<div class="carousel-block"><div class="owl-carousel">';
    $carouselModule = get_posts(array('post_type' => 'module', 'module_category' => $category, 'name' => $slug));
    if (isset($carouselModule[0])) {
        $carouselGalleryImages = get_post_gallery_images($carouselModule[0]->ID);
        foreach ($carouselGalleryImages as $image) {
            $carouselBlock .= '<div><img src="' . $image . '" /></div>';
        }
    }
    $carouselBlock .= '</div></div>';
    return $carouselBlock;
}
开发者ID:gurustump,项目名称:cyclegarden,代码行数:14,代码来源:functions.php

示例10: the_permalink

			<li class="slide">
                            <a class="">
				<!-- <a href="<?php 
                the_permalink();
                ?>
" rel="bookmark"> -->
                                    
				<?php 
                //if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) {
                ?>
				
				<?php 
                //the_post_thumbnail('post-thumb');
                if (get_post_gallery()) {
                    $gallery = get_post_gallery(get_the_ID(), false);
                    $galleryImg = get_post_gallery_images(get_the_ID());
                    /* Loop through all the image and output them one by one */
                    foreach ($gallery['src'] as $g) {
                        $full = str_replace('-150x150', '', $g);
                        ?>
                                        <a class="fancybox" href="<?php 
                        echo $full;
                        ?>
" rel="<?php 
                        echo $post->ID;
                        ?>
">
                                            <div class="slider_img_container">
                                            <img src="<?php 
                        echo $g;
                        ?>
开发者ID:patryckgratao,项目名称:projeto-maravista,代码行数:31,代码来源:newEmptyPHP.php

示例11: plp_shortcode


//.........这里部分代码省略.........
                            }
                            if (($alt = $alt * -1) == 1) {
                                $cls = 'alt';
                            }
                            $var_dropdown .= '<td class="' . $cls . '" style="border:none; width: 180px;">';
                            $var_dropdown .= wc_attribute_label($attribute['name']);
                            //$content .= '<td id="variationtd">';
                            if ($attribute['is_taxonomy']) {
                                $values = wc_get_product_terms($product->id, $attribute['name'], array('fields' => 'names'));
                                $var_dropdown .= '<select name="' . $attribute['name'] . '-' . $product->id . '">';
                                foreach ($values as $val) {
                                    $var_dropdown .= '<option value="' . $val . '">' . $val . '</option>';
                                }
                                $var_dropdown .= '</select>';
                            } else {
                                // Convert pipes to commas and display values
                                $values = array_map('trim', explode(WC_DELIMITER, $attribute['value']));
                                $var_dropdown .= '<select name="' . $attribute['name'] . '[' . $product->id . ']">';
                                foreach ($values as $val) {
                                    $var_dropdown .= '<option value="' . $val . '">' . $val . '</option>';
                                }
                                $var_dropdown .= '</select>';
                            }
                            $var_dropdown .= '</td>';
                        }
                        $var_dropdown .= '</tr>';
                        $var_dropdown .= '</table>';
                        $content .= '<tr>';
                        foreach ($fieldOrder as $field => $order) {
                            switch ($field) {
                                case 'name':
                                    if ($atts['producttitle'] == 'true') {
                                        if (isset($atts['image']) && $atts['image'] == 'true' && $atts['imageintitle'] == 'true') {
                                            $gal_images = get_post_gallery_images(get_the_ID());
                                            $content .= '<td>' . get_the_post_thumbnail(get_the_ID(), array(200, 200));
                                            if ($atts['producttitle'] == 'true') {
                                                $content .= '<br />' . $varTitle;
                                            }
                                            $content .= '</td>';
                                        } else {
                                            $content .= '<td>' . $varTitle . '</td>';
                                        }
                                    }
                                    break;
                                case 'image':
                                    if ($atts['image'] == 'true' && $atts['imageintitle'] != 'true') {
                                        $attachment_ids = $product->get_gallery_attachment_ids();
                                        $image_links = [];
                                        $content .= '<td class="image">';
                                        foreach ($attachment_ids as $attachment_id) {
                                            $image_links[] = wp_get_attachment_url($attachment_id);
                                            $content .= '<a href="' . wp_get_attachment_url($attachment_id) . '" data-lightbox="image-' . get_the_ID() . '" data-title="' . $product->get_title() . '"><img src="' . wp_get_attachment_url($attachment_id) . '"' . ' alt="picture" /></a>';
                                            //                                            $content .= ;
                                        }
                                        $content .= '</td>';
                                    }
                                    break;
                                case 'excerpt':
                                    if ($atts['excerpt'] == 'true') {
                                        $content .= '<td>' . pramnos_shortenText(get_the_excerpt(), get_option('plp_excerptlength')) . '</td>';
                                    }
                                    break;
                                case 'content':
                                    //customized content here - Brian3T
                                    if ($atts['content'] == 'true') {
                                        $content .= '<td class="content">';
开发者ID:brian3t,项目名称:orchidmate,代码行数:67,代码来源:plugin.php

示例12: tutannet_gallery_post

function tutannet_gallery_post()
{
    global $post;
    // Only do this on singular items
    if (!is_singular()) {
        return false;
    }
    // Retrieve the first gallery in the post
    $gallery = get_post_gallery_images($post);
    $image_list = '
	<div class="col-sx-12 col-sm-12 col-md-4 col-lg-4 post-desc-wrapper">
	    <div class="block-poston">' . tutannet_posted_on() . '</div>
	    <h3 class="post-title"><a post-title="' . get_the_title() . '" rel="' . get_the_ID() . '" href="' . get_the_permalink() . '" >' . get_the_title() . '</a></h3>
	    <div class="post-content">' . get_the_excerpt() . '</div>
	</div>
	<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 gallery_post_img_wrapper">
		<div class="col-xs-6 col-sm-6 col-md-12 col-lg-12 gallery_post_img_left_wrapper">
			<div class="col-sm-12 col-lg-6 gallery_post_img">
				<img src="' . $gallery[0] . '"/>
			</div>
			<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 gallery_post_img">
				<img src="' . $gallery[1] . '"/>
			</div>
		</div>
		<div class="col-xs-6 col-sm-6 col-md-12 col-lg-12 gallery_post_img_right_wrapper">
			<img src="' . $gallery[2] . '"/>
		</div>
	</div>';
    $content .= $image_list;
    echo $content;
}
开发者ID:vinhvv75,项目名称:tutannet,代码行数:31,代码来源:tutannet-functions.php

示例13: array

						<div  id="zl_albums">

							<?php 
$args = array('post_type' => 'zl_album', 'post_status' => 'publish', 'posts_per_page' => -1, 'orderby' => 'DATE', 'order' => 'DESC', 'paged' => $pageds, 'ignore_sticky_posts' => 1);
$album = new WP_Query($args);
?>
							<?php 
if ($album->have_posts()) {
    while ($album->have_posts()) {
        $album->the_post();
        //Let's Generate the Thumbnail.
        $thumb = get_post_thumbnail_id();
        $img_url = wp_get_attachment_url($thumb, 'full');
        $image = zl_theme_thumb($img_url, 300, 300, 'c', true);
        //Define Gallery Images
        $gallery = get_post_gallery_images();
        //Count Items
        $items = count($gallery);
        //Get First Item if featured image isn't set.
        $firstimg = reset($gallery);
        $firstimg = str_replace('-150x150', '', $firstimg);
        //Crop the first image.
        $firstimg = zl_theme_thumb($firstimg, 300, 300, 'c', true);
        ?>
								<!-- Album Loop -->
								<div class="zl_album_parent large-4 column">
									<div class="zl_album" data-albumlink='<?php 
        the_permalink();
        ?>
' data-albumid="<?php 
        the_ID();
开发者ID:webtechfreaky,项目名称:vienna-content-focused-personal-blog-theme,代码行数:31,代码来源:template-albums-3-columns.php

示例14: jkl_get_gallery_images

/**
 * Post Format: Gallery
 * 
 * Get specified number of Gallery images from the first Gallery in a post
 * Used primarily on index and archive pages
 */
function jkl_get_gallery_images($num = 3)
{
    // Array to hold all the images we retrieve
    $images = get_post_gallery_images();
    if (!empty($images)) {
        $size = count($images) > $num ? $num : count($images);
        if (has_post_thumbnail()) {
            $size--;
        }
        $images = array_slice($images, 0, $size);
    }
    return $images;
}
开发者ID:jekkilekki,项目名称:theme-jkl,代码行数:19,代码来源:template-tags.php

示例15: modality_gallery_post

/** 
 * Function to display image slider in gallery post formats.
*/
function modality_gallery_post()
{
    global $post;
    ?>
	<div class="flexslider">
		<ul class="slides">	
		<?php 
    //Pull gallery images from custom meta
    $gallery_image = get_post_gallery_images($post);
    if ($gallery_image != '') {
        foreach ($gallery_image as $arr) {
            echo '<li><img src="' . $arr . '" alt="' . $arr . '" /></li>';
        }
    }
    ?>
		
		</ul>
	</div>	
	<?php 
    wp_enqueue_script('gallery-slides', get_template_directory_uri() . '/js/gallery-slides.js', array('jquery'), '', true);
}
开发者ID:nezzo,项目名称:privat_oplata,代码行数:24,代码来源:modality-functions.php


注:本文中的get_post_gallery_images函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。