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


PHP grab_ids_from_gallery函数代码示例

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


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

示例1: gallery_filter

function gallery_filter($atts, $content = null)
{
    extract(shortcode_atts(array('gallery_name' => ''), $args));
    $args = array('post_type' => 'attachment', 'posts_per_page' => -1, 'post_parent' => $post->ID, 'order' => 'ASC', 'orderby' => 'menu_order', 'post_mime_type' => 'image');
    $output .= "<div id='slider' class='swipe'><div class='swipe-wrap'>";
    $attachments = get_posts($args);
    $grabids = grab_ids_from_gallery();
    if ($attachments) {
        foreach ($attachments as $attachment) {
            if (in_array($attachment->ID, $grabids)) {
                $output .= "<div><img class='slide' src='" . wp_get_attachment_url($attachment->ID) . "' /></div>";
            }
        }
        $output .= " </div><div class='swipe__nav swipe__prev'><i class='icon-left-open-big'></i></div>\n                          <div class='swipe__nav swipe__next'><i class='icon-right-open-big'></i></div></div>";
    }
    return $output;
}
开发者ID:synergia,项目名称:mknm-synergia-theme,代码行数:17,代码来源:slider.php

示例2: get_post_meta

		<?php 
$enable_gallery_slider = get_post_meta(get_the_ID(), '_nectar_gallery_slider', true);
?>
		
		<div class="content-inner <?php 
if (!empty($enable_gallery_slider) && $enable_gallery_slider == 'on') {
    echo 'gallery-slider';
}
?>
">
			
			<?php 
$gallery = get_children('post_type=attachment&post_mime_type=image&output=ARRAY_N&orderby=menu_order&order=ASC&post_parent=' . $post->post_parent);
$attr = array('class' => "attachment-full wp-post-image");
if (!empty($enable_gallery_slider) && $enable_gallery_slider == 'on') {
    $gallery_ids = grab_ids_from_gallery();
    ?>
					
				<div class="flex-gallery"> 
						 <ul class="slides">
						 	<?php 
    foreach ($gallery_ids as $image_id) {
        echo '<li>' . wp_get_attachment_image($image_id, '', false, $attr) . '</li>';
    }
    ?>
				    	</ul>
			   	 </div><!--/gallery-->
		   	  	
		   	<?php 
}
?>
开发者ID:Quartermain,项目名称:strategic,代码行数:31,代码来源:entry-gallery.php

示例3: grab_ids_from_gallery

        
    </div><!-- .columns -->
</div><!-- .row -->
  
  
<div class="gallery-slider-wrapper">
    <div class="gallery-slider">
        <div class="swiper-container post-id-<?php 
echo $post->ID;
?>
 format-gallery-swiper">
            <div class="swiper-wrapper">
    
                <?php 
$galleryImages = grab_ids_from_gallery();
$imagesCount = count(grab_ids_from_gallery());
if ($imagesCount > 0) {
    for ($i = 0; $i < $imagesCount; $i++) {
        if (!empty($galleryImages[$i])) {
            //$imageMarkup = wp_get_attachment_image( $galleryImages[$i], array(1200,900) );
            $imageSrc = wp_get_attachment_image_src($galleryImages[$i], array(1200, 900));
            ?>
    
                                <div class="swiper-slide"><img src="<?php 
            echo $imageSrc[0];
            ?>
"></div>
    
                            <?php 
        }
    }
开发者ID:renatodex,项目名称:submundo-blogstore,代码行数:30,代码来源:content-gallery.php

示例4: nectar_recent_posts


//.........这里部分代码省略.........
						<div class="audio-wrap">		
							<?php 
                    if ($wp_version < "3.6") {
                        nectar_audio($post->ID);
                    } else {
                        $audio_mp3 = get_post_meta($post->ID, '_nectar_audio_mp3', true);
                        $audio_ogg = get_post_meta($post->ID, '_nectar_audio_ogg', true);
                        if (!empty($audio_ogg) || !empty($audio_mp3)) {
                            $audio_output = '[audio ';
                            if (!empty($audio_mp3)) {
                                $audio_output .= 'mp3="' . $audio_mp3 . '" ';
                            }
                            if (!empty($audio_ogg)) {
                                $audio_output .= 'ogg="' . $audio_ogg . '"';
                            }
                            $audio_output .= ']';
                            echo do_shortcode($audio_output);
                        }
                    }
                    ?>
						</div><!--/audio-wrap-->
					<?php 
                } else {
                    if (get_post_format() == 'gallery') {
                        if ($wp_version < "3.6") {
                            if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'second-slide')) {
                                nectar_gallery($post->ID);
                            } else {
                                if (has_post_thumbnail()) {
                                    echo get_the_post_thumbnail($post->ID, 'portfolio-thumb', array('title' => ''));
                                }
                            }
                        } else {
                            $gallery_ids = grab_ids_from_gallery();
                            ?>
				
							<div class="flex-gallery"> 
									 <ul class="slides">
									 	<?php 
                            foreach ($gallery_ids as $image_id) {
                                echo '<li>' . wp_get_attachment_image($image_id, 'portfolio-thumb', false) . '</li>';
                            }
                            ?>
							    	</ul>
						   	 </div><!--/gallery-->

				   <?php 
                        }
                    } else {
                        if (has_post_thumbnail()) {
                            echo '<a href="' . get_permalink() . '">' . get_the_post_thumbnail($post->ID, 'portfolio-thumb', array('title' => '')) . '</a>';
                        }
                    }
                }
            }
            ?>

				<div class="post-header">
					<h3 class="title"><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h3>	
					<span class="meta-author"><?php 
开发者ID:nignjatov,项目名称:TaxiDev,代码行数:67,代码来源:shortcode-processing.php

示例5: nectar_recent_posts


//.........这里部分代码省略.........
								<div class="audio-wrap">		
									<?php 
                            if ($wp_version < "3.6") {
                                nectar_audio($post->ID);
                            } else {
                                $audio_mp3 = get_post_meta($post->ID, '_nectar_audio_mp3', true);
                                $audio_ogg = get_post_meta($post->ID, '_nectar_audio_ogg', true);
                                if (!empty($audio_ogg) || !empty($audio_mp3)) {
                                    $audio_output = '[audio ';
                                    if (!empty($audio_mp3)) {
                                        $audio_output .= 'mp3="' . $audio_mp3 . '" ';
                                    }
                                    if (!empty($audio_ogg)) {
                                        $audio_output .= 'ogg="' . $audio_ogg . '"';
                                    }
                                    $audio_output .= ']';
                                    echo do_shortcode($audio_output);
                                }
                            }
                            ?>
								</div><!--/audio-wrap-->
							<?php 
                        } else {
                            if (get_post_format() == 'gallery') {
                                if ($wp_version < "3.6") {
                                    if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'second-slide')) {
                                        nectar_gallery($post->ID);
                                    } else {
                                        if (has_post_thumbnail()) {
                                            echo get_the_post_thumbnail($post->ID, 'portfolio-thumb', array('title' => ''));
                                        }
                                    }
                                } else {
                                    $gallery_ids = grab_ids_from_gallery();
                                    ?>
						
									<div class="flex-gallery"> 
											 <ul class="slides">
											 	<?php 
                                    foreach ($gallery_ids as $image_id) {
                                        echo '<li>' . wp_get_attachment_image($image_id, 'portfolio-thumb', false) . '</li>';
                                    }
                                    ?>
									    	</ul>
								   	 </div><!--/gallery-->

						   <?php 
                                }
                            } else {
                                if (has_post_thumbnail()) {
                                    echo '<a href="' . get_permalink() . '">' . get_the_post_thumbnail($post->ID, 'portfolio-thumb', array('title' => '')) . '</a>';
                                }
                            }
                        }
                    }
                    ?>

							<div class="post-header">
								<h3 class="title"><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h3>	
								<span class="meta-author"><?php 
开发者ID:JPodz,项目名称:harlequinnejuice,代码行数:67,代码来源:shortcode-processing.php

示例6: the_title

						<header class="entry-header margin-btm sr-only">
						
							<?php 
    the_title('<h1 class="entry-title">', '</h1>');
    ?>
						
						</header><!-- .entry-header -->
					
						<div class="entry-content">
						
							<?php 
    // the_content();
    ?>
								
							<?php 
    $attachments = grab_ids_from_gallery();
    $i = 0;
    if ($attachments) {
        foreach ($attachments as $attachment) {
            $i++;
            $image_thumb = wp_get_attachment_image_src($attachment, 'thumbnail')[0];
            $image_lg = wp_get_attachment_image_src($attachment, 'large')[0];
            $title = get_the_title($attachment);
            //if ( ($i % 7 != 0) == 0) echo '<div class="row">';
            //$array = array(1,5,11,16,21,26);
            $array = array(1, 7, 13, 19, 25, 31);
            if (in_array($i, $array)) {
                echo '<div class="row">';
            }
            ?>
									
开发者ID:aburi,项目名称:wp-content,代码行数:30,代码来源:portfolio.php


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