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


PHP Attachments::src方法代码示例

本文整理汇总了PHP中Attachments::src方法的典型用法代码示例。如果您正苦于以下问题:PHP Attachments::src方法的具体用法?PHP Attachments::src怎么用?PHP Attachments::src使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Attachments的用法示例。


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

示例1: array

                <div class="swiper-button-next"></div>
            <?php 
}
?>
               
            </div>         
        <a href="#project-inside" class="discover-more">Discover</a>



 <?php 
$gallery = array();
$attachments = new Attachments('attachments', get_the_ID());
if ($attachments->exist()) {
    while ($attachments->get()) {
        array_push($gallery, $attachments->src('full'));
    }
}
//ottengo il contenuto
$content = "";
if (have_posts()) {
    // Start the loop.
    while (have_posts()) {
        the_post();
        $content = get_the_content();
        // End the loop.
    }
}
//ottengo gli artisti
$pages = get_posts(array('post_type' => 'page', 'meta_key' => '_wp_page_template', 'meta_value' => 'page-artist.php'));
$artists = array();
开发者ID:alexvezz87,项目名称:tema_bed_and_art,代码行数:31,代码来源:page-visit.php

示例2: while

		<div class="carousel-inner" role="listbox">
			<?php 
    while ($index = $attachments->get()) {
        ?>
			<div class="item<?php 
        if ($index->id == $attachments->id(0)) {
            ?>
 active<?php 
        }
        ?>
" data-title="<?php 
        echo sanitize_title($attachments->field('title'));
        ?>
" style="background-image:url(<?php 
        echo $attachments->src('full');
        ?>
);"></div>
			<?php 
    }
    ?>
		</div>
	
		<h1 id="keywords">
			<span id="ignite">Ignite.</span>
			<span id="align">Align.</span>
			<span id="mobilize">Mobilize.</span>
		</h1>
	
	</div>
	<?php 
开发者ID:joshreisner,项目名称:consilience,代码行数:30,代码来源:front-page.php

示例3: rcl_gallery_product

function rcl_gallery_product($content)
{
    global $post;
    if (get_post_type($post->ID) == 'products') {
        if (get_post_meta($post->ID, 'recall_slider', 1) != 1 || !is_single()) {
            return $content;
        }
        if (!class_exists('Attachments')) {
            $postmeta = get_post_meta($post->ID, 'children_prodimage', 1);
            if ($postmeta) {
                rcl_bxslider_scripts();
                $values = explode(',', $postmeta);
                $gallery = '<div id="product-gallery">' . '<ul class="rcl-gallery">';
                foreach ((array) $values as $children) {
                    $large = wp_get_attachment_image_src($children, 'large');
                    $gallery .= '<li><a class="fancybox" href="' . $large[0] . '"><img src="' . $large[0] . '"></a></li>';
                    $thumbs[] = $large[0];
                }
                $gallery .= '</ul>';
                if (count($thumbs) > 1) {
                    $gallery .= '<div id="bx-pager">';
                    foreach ($thumbs as $k => $src) {
                        $gallery .= '<a data-slide-index="' . $k . '" href=""><img src="' . $src . '" /></a>';
                    }
                    $gallery .= '</div>';
                }
                $gallery .= '</div>';
            }
            return $gallery . $content;
        } else {
            $attachments = new Attachments('attachments_products');
            if ($attachments->exist()) {
                rcl_bxslider_scripts();
                $num = 0;
                $gallery = '<div id="product-gallery">' . '<ul class="rcl-gallery">';
                while ($attachments->get()) {
                    $num++;
                    $large = wp_get_attachment_image_src($children, 'large');
                    $gallery .= '<li><a class="fancybox" href="' . $attachments->src('full') . '"><img src="' . $attachments->src('thumbnail') . '"></a></li>';
                    $thumbs[] = $large[0];
                }
                $gallery .= '</ul>';
                $gallery .= '<div id="bx-pager">';
                foreach ($thumbs as $k => $src) {
                    $gallery .= '<a data-slide-index="' . $k . '" href=""><img src="' . $src . '" /></a>';
                }
                $gallery .= '</div>';
            }
            $gallery .= '</div>';
            return $gallery . $content;
        }
    } else {
        return $content;
    }
}
开发者ID:stanislav-chechun,项目名称:campus-rize,代码行数:55,代码来源:functions.php

示例4:

        ?>
								<div class="col-md-6<?php 
        if ($index->id == $attachments->id(0)) {
            ?>
 active<?php 
        }
        ?>
">
									<div class="thumbnail<?php 
        if ($index->id == $attachments->id(0)) {
            ?>
 active<?php 
        }
        ?>
" style="background-image:url(<?php 
        echo $attachments->src('medium');
        ?>
)"></div>
								</div>
							<?php 
    }
    ?>
							<!-- <div class="col-md-12"><hr></div> -->
						</div>
						<?php 
}
?>
						
						<?php 
the_content();
?>
开发者ID:joshreisner,项目名称:consilience,代码行数:31,代码来源:page-contact.php

示例5: get_attachments_array

function get_attachments_array($name, $srcSize = 'full')
{
    $return = array();
    $attachments = new Attachments($name);
    if ($attachments->exist()) {
        $i = 0;
        while ($attachments->get()) {
            $return[$i]['id'] = $attachments->id();
            $return[$i]['type'] = $attachments->type();
            $return[$i]['subtype'] = $attachments->subtype();
            $return[$i]['url'] = $attachments->url();
            $return[$i]['thumbnail'] = $attachments->image('thumbnail');
            $return[$i]['srcfull'] = $attachments->src('full');
            $return[$i]['src'] = $attachments->src($srcSize);
            $return[$i]['filesize'] = $attachments->filesize();
            $return[$i]['title'] = $attachments->field('title');
            $return[$i]['caption'] = $attachments->field('caption');
            $i++;
        }
    }
    return $return;
}
开发者ID:santikrass,项目名称:apache,代码行数:22,代码来源:functions.php


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