• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP grab_ids_from_gallery函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP grab_timeframe函数代码示例发布时间:2022-05-15
下一篇:
PHP gpsa函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap