本文整理汇总了PHP中get_thumbnail函数的典型用法代码示例。如果您正苦于以下问题:PHP get_thumbnail函数的具体用法?PHP get_thumbnail怎么用?PHP get_thumbnail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_thumbnail函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_thumbnail
function get_thumbnail($dir)
{
$list = lister($dir, FALSE);
// we don't care about thumbs, so save some time
if (isset($list['picture']['thumbnail.jpg']) === TRUE) {
return 'thumbnail.jpg';
} else {
if (isset($list['picture']) === TRUE && sizeof($list['picture']) > 0) {
// get first picture file in the folder
$key = key($list['picture']);
// get current value
return $list['picture'][$key]['big'];
} else {
if (isset($list['folder']) === TRUE && sizeof($list['folder']) > 0) {
// search in sub folders
foreach ($list['folder'] as $a_folder) {
// recursivity FTW
$a_folder_thumb = get_thumbnail($dir . '/' . $a_folder);
if ($a_folder_thumb !== '') {
return $a_folder . '/' . $a_folder_thumb;
}
}
}
}
}
return '';
// nothing was found
}
开发者ID:romaricdrigon,项目名称:EasyGallery,代码行数:28,代码来源:lister.php
示例2: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? 'Photostream' : $instance['title']);
$posts_number = empty($instance['posts_number']) ? '' : $instance['posts_number'];
$blog_category = empty($instance['blog_category']) ? '' : $instance['blog_category'];
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
?>
<div class="photostream clearfix">
<?php
query_posts("showposts=" . $posts_number . "&cat=" . $blog_category);
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<?php
$thumb = '';
$width = 67;
$height = 67;
$classtext = 'post-thumb';
$titletext = get_the_title();
$thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Entry');
$thumb = $thumbnail["thumb"];
?>
<div class="thumb">
<a href="<?php
the_permalink();
?>
">
<?php
print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
?>
<span class="overlay"></span>
</a>
</div> <!-- end .post-thumbnail -->
<?php
}
}
wp_reset_query();
?>
</div> <!-- end .photostream -->
<?php
echo $after_widget;
}
开发者ID:natduffy,项目名称:wp-sandbox,代码行数:49,代码来源:widget-photostream.php
示例3: render_link
function render_link($id, $title, $author, $app_id, $self = TRUE)
{
$output = '<div class="tomove">';
$output .= '<h2>' . $title . '</h2>';
$output .= '<a ';
if (!$self) {
$output .= 'target="_blank" ';
}
$output .= 'href="' . $app_id . '">';
$img = get_thumbnail($id);
$output .= '<img alt="' . $title . ' by ' . $author . '" class="thumbnail img-responsive" src="' . $img . '" />';
$output .= '</a>';
//echo '<iframe type="text/html" width="640" height="390" src="http://www.youtube.com/embed/' . $obj->youtube_id . '" frameborder="0"/>';
$output .= '<span class="label label-info">' . $author . '</span>';
$output .= '</div>';
return $output;
}
开发者ID:RoyceKimmons,项目名称:EdTech-Projects,代码行数:17,代码来源:index.php
示例4: is_front_page
$et_paged = is_front_page() ? get_query_var('page') : get_query_var('paged');
?>
<?php
query_posts("posts_per_page={$et_ptemplate_gallery_perpage}&paged=" . $et_paged . $gallery_query);
?>
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<?php
$width = 207;
$height = 136;
$titletext = get_the_title();
$thumbnail = get_thumbnail($width, $height, 'portfolio', $titletext, $titletext, true, 'Portfolio');
$thumb = $thumbnail["thumb"];
?>
<div class="et_pt_gallery_entry">
<div class="et_pt_item_image">
<?php
print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, 'portfolio');
?>
<span class="overlay"></span>
<a class="zoom-icon fancybox" title="<?php
the_title_attribute();
?>
" rel="gallery" href="<?php
echo $thumbnail['fullpath'];
开发者ID:javierdlahoz,项目名称:paella-development,代码行数:31,代码来源:page-gallery.php
示例5: the_title
the_title();
?>
</h1>
<span class="et_project_categories"><?php
echo get_the_term_list(get_the_ID(), 'project_category', '', ', ');
?>
</span>
</div>
<?php
$thumb = '';
$width = (int) apply_filters('et_pb_portfolio_single_image_width', 1080);
$height = (int) apply_filters('et_pb_portfolio_single_image_height', 9999);
$classtext = 'et_featured_image';
$titletext = get_the_title();
$thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Projectimage');
$thumb = $thumbnail["thumb"];
$page_layout = get_post_meta(get_the_ID(), '_et_pb_page_layout', true);
if ('' !== $thumb) {
print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height);
}
?>
<?php
}
?>
<div class="entry-content">
<?php
the_content();
if (!$is_page_builder_used) {
开发者ID:iinspiration,项目名称:theme,代码行数:31,代码来源:single-project.php
示例6: et_pb_filterable_portfolio
function et_pb_filterable_portfolio($atts)
{
extract(shortcode_atts(array('module_id' => '', 'module_class' => '', 'fullwidth' => 'on', 'posts_number' => 10, 'include_categories' => '', 'show_title' => 'on', 'show_categories' => 'on', 'show_pagination' => 'on', 'background_layout' => 'light'), $atts));
wp_enqueue_script('jquery-masonry-3');
wp_enqueue_script('hashchange');
$args = array();
if ('on' === $show_pagination) {
$args['nopaging'] = true;
} else {
$args['posts_per_page'] = (int) $posts_number;
}
if ('' !== $include_categories) {
$args['tax_query'] = array(array('taxonomy' => 'project_category', 'field' => 'id', 'terms' => explode(',', $include_categories), 'operator' => 'IN'));
}
$projects = et_divi_get_projects($args);
$categories_included = array();
ob_start();
if ($projects->post_count > 0) {
while ($projects->have_posts()) {
$projects->the_post();
$category_classes = array();
$categories = get_the_terms(get_the_ID(), 'project_category');
if ($categories) {
foreach ($categories as $category) {
$category_classes[] = 'project_category_' . $category->slug;
$categories_included[] = $category->term_id;
}
}
$category_classes = implode(' ', $category_classes);
?>
<div id="post-<?php
the_ID();
?>
" <?php
post_class('et_pb_portfolio_item ' . $category_classes);
?>
>
<?php
$thumb = '';
$width = 'on' === $fullwidth ? 1080 : 400;
$width = (int) apply_filters('et_pb_portfolio_image_width', $width);
$height = 'on' === $fullwidth ? 9999 : 284;
$height = (int) apply_filters('et_pb_portfolio_image_height', $height);
$classtext = 'on' === $fullwidth ? 'et_pb_post_main_image' : '';
$titletext = get_the_title();
$thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Blogimage');
$thumb = $thumbnail["thumb"];
if ('' !== $thumb) {
?>
<a href="<?php
the_permalink();
?>
">
<?php
if ('on' !== $fullwidth) {
?>
<span class="et_portfolio_image">
<?php
}
?>
<?php
print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height);
?>
<?php
if ('on' !== $fullwidth) {
?>
<span class="et_overlay"></span>
</span>
<?php
}
?>
</a>
<?php
}
?>
<?php
if ('on' === $show_title) {
?>
<h2><a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></h2>
<?php
}
?>
<?php
if ('on' === $show_categories) {
?>
<p class="post-meta"><?php
echo get_the_term_list(get_the_ID(), 'project_category', '', ', ');
?>
</p>
<?php
}
?>
//.........这里部分代码省略.........
开发者ID:ahmedghazi,项目名称:tpls,代码行数:101,代码来源:functions.php
示例7: et_show_ajax_project
function et_show_ajax_project()
{
global $wp_embed;
$project_id = (int) $_POST['et_project_id'];
$portfolio_args = array('post_type' => 'project', 'p' => $project_id);
$portfolio_query = new WP_Query(apply_filters('et_ajax_portfolio_args', $portfolio_args));
while ($portfolio_query->have_posts()) {
$portfolio_query->the_post();
global $post;
$width = (int) apply_filters('et_ajax_media_width', 600);
$height = (int) apply_filters('et_ajax_media_height', 480);
$titletext = get_the_title();
$media = get_post_meta(get_the_ID(), '_et_used_images', true);
echo '<div class="et_media">';
if ($media) {
echo '<div class="flexslider"><ul class="slides">';
foreach ((array) $media as $et_media) {
echo '<li class="slide">';
if (is_numeric($et_media)) {
$et_fullimage_array = wp_get_attachment_image_src($et_media, 'full');
if ($et_fullimage_array) {
$et_fullimage = $et_fullimage_array[0];
echo '<img src="' . esc_attr(et_new_thumb_resize(et_multisite_thumbnail($et_fullimage), $width, $height, '', true)) . '" width="' . esc_attr($width) . '" height="' . esc_attr($height) . '" alt="' . esc_attr($titletext) . '" />';
}
} else {
$video_embed = apply_filters('the_content', $wp_embed->shortcode('', esc_url($et_media)));
$video_embed = preg_replace('/<embed /', '<embed wmode="transparent" ', $video_embed);
$video_embed = preg_replace('/<\\/object>/', '<param name="wmode" value="transparent" /></object>', $video_embed);
$video_embed = preg_replace("/height=\"[0-9]*\"/", "height={$height}", $video_embed);
$video_embed = preg_replace("/width=\"[0-9]*\"/", "width={$width}", $video_embed);
echo $video_embed;
}
echo '</li>';
}
echo '</ul></div>';
} else {
$thumb = '';
$classtext = '';
$titletext = get_the_title();
$thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Ajaximage');
$thumb = $thumbnail["thumb"];
echo '<a href="' . esc_url(get_permalink()) . '">';
print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
echo '</a>';
}
echo '</div> <!-- end .et_media -->';
echo '<div class="et_media_description">' . '<h2 class="title">' . '<a href="' . get_permalink() . '">' . get_the_title() . '</a>' . '</h2>' . truncate_post(560, false);
echo '</div> <!-- end .et_media_description -->';
echo '<a class="more" href="' . get_permalink() . '">' . __('More info »', 'Flexible') . '</a>';
}
wp_reset_postdata();
die;
}
开发者ID:AttyC,项目名称:elizafilby,代码行数:53,代码来源:functions.php
示例8: success_template
}
if(isset($success))
{
echo success_template('Image was successfully uploaded <a class="btn btn-sm btn-primary" href="'.current_url().'">Refresh page</a>');
}
?>
<input type="hidden" name="user_id" value="<?=$user_id?>" class="form-control" id="user_id" >
<div class="form-group">
<label class="col-md-2 control-label"></label>
<div class="col-md-10">
<div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;"><img src="<?=base_url().'uploads/avatars/'.get_thumbnail($avatar)?>"></div>
<?php
$data = array
(
'name' => 'userfile',
'id' => 'userfile',
'value' => set_value('userfile'),
'maxlength' => '',
'size' => '',
'style' => '',
'class' => 'fileinput btn-info',
'data-filename-placement' =>'inside',
'title' =>'New filename goes inside'
);
echo form_upload($data);
开发者ID:rmuyinda,项目名称:dms-1,代码行数:31,代码来源:upload_profile_img_f.php
示例9: while
<div id="content-area">
<div class="container clearfix fullwidth">
<div id="main-area">
<?php
while (have_posts()) {
the_post();
?>
<article class="entry clearfix">
<?php
$thumb = '';
$width = (int) apply_filters('et_single_project_image_width', 9999);
$height = (int) apply_filters('et_single_project_image_height', 9999);
$classtext = 'et-main-project-thumb';
$titletext = get_the_title();
$thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'SingleProject');
$thumb = $thumbnail["thumb"];
print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
the_content();
et_gallery_images();
wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'Vertex'), 'after' => '</div>'));
?>
</article> <!-- .entry -->
<?php
if (comments_open() && 'on' == et_get_option('vertex_show_postcomments', 'on')) {
comments_template('', true);
}
}
?>
开发者ID:Rehabescapi,项目名称:GVSU-Senior-Project-Hola,代码行数:30,代码来源:single-project.php
示例10: shortcode_callback
function shortcode_callback($atts, $content = null, $function_name)
{
$module_id = $this->shortcode_atts['module_id'];
$module_class = $this->shortcode_atts['module_class'];
$fullwidth = $this->shortcode_atts['fullwidth'];
$posts_number = $this->shortcode_atts['posts_number'];
$include_categories = $this->shortcode_atts['include_categories'];
$meta_date = $this->shortcode_atts['meta_date'];
$show_thumbnail = $this->shortcode_atts['show_thumbnail'];
$show_content = $this->shortcode_atts['show_content'];
$show_author = $this->shortcode_atts['show_author'];
$show_date = $this->shortcode_atts['show_date'];
$show_categories = $this->shortcode_atts['show_categories'];
$show_comments = $this->shortcode_atts['show_comments'];
$show_pagination = $this->shortcode_atts['show_pagination'];
$background_layout = $this->shortcode_atts['background_layout'];
$show_more = $this->shortcode_atts['show_more'];
$offset_number = $this->shortcode_atts['offset_number'];
$masonry_tile_background_color = $this->shortcode_atts['masonry_tile_background_color'];
$use_dropshadow = $this->shortcode_atts['use_dropshadow'];
global $paged;
$module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
$container_is_closed = false;
// remove all filters from WP audio shortcode to make sure current theme doesn't add any elements into audio module
remove_all_filters('wp_audio_shortcode_library');
remove_all_filters('wp_audio_shortcode');
remove_all_filters('wp_audio_shortcode_class');
if ('' !== $masonry_tile_background_color) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_blog_grid .et_pb_post', 'declaration' => sprintf('background-color: %1$s;', esc_html($masonry_tile_background_color))));
}
if ('on' !== $fullwidth) {
if ('on' === $use_dropshadow) {
$module_class .= ' et_pb_blog_grid_dropshadow';
}
wp_enqueue_script('salvattore');
$background_layout = 'light';
}
$args = array('posts_per_page' => (int) $posts_number);
$et_paged = is_front_page() ? get_query_var('page') : get_query_var('paged');
if (is_front_page()) {
$paged = $et_paged;
}
if ('' !== $include_categories) {
$args['cat'] = $include_categories;
}
if (!is_search()) {
$args['paged'] = $et_paged;
}
if ('' !== $offset_number && !empty($offset_number)) {
/**
* Offset + pagination don't play well. Manual offset calculation required
* @see: https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination
*/
if ($paged > 1) {
$args['offset'] = ($et_paged - 1) * intval($posts_number) + intval($offset_number);
} else {
$args['offset'] = intval($offset_number);
}
}
if (is_single() && !isset($args['post__not_in'])) {
$args['post__not_in'] = array(get_the_ID());
}
ob_start();
query_posts($args);
if (have_posts()) {
?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/masonry/3.3.2/masonry.pkgd.js"></script>
<div class="grid js-masonry"
data-masonry-options='{ "itemSelector": ".new-post", "columnWidth": ".grid-sizer", "percentPosition": true}'>
<div class="grid-sizer"></div>
<?php
while (have_posts()) {
the_post();
$post_format = et_pb_post_format();
$thumb = '';
$width = 'on' === $fullwidth ? 1080 : 400;
$width = (int) apply_filters('et_pb_blog_image_width', $width);
$height = 'on' === $fullwidth ? 675 : 250;
$height = (int) apply_filters('et_pb_blog_image_height', $height);
$classtext = 'on' === $fullwidth ? 'et_pb_post_main_image' : '';
$titletext = get_the_title();
$thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Blogimage');
$thumb = $thumbnail["thumb"];
$no_thumb_class = '' === $thumb || 'off' === $show_thumbnail ? ' et_pb_no_thumb' : '';
if (in_array($post_format, array('video', 'gallery'))) {
$no_thumb_class = '';
}
?>
<article onclick="location.href='<?php
the_permalink();
?>
';" style="cursor:pointer;" id="post-<?php
the_ID();
?>
" class="new-post <?php
$cat_color = get_the_category();
echo $cat_color[1]->slug;
echo ' ';
?>
//.........这里部分代码省略.........
开发者ID:skonina,项目名称:M20_masonry,代码行数:101,代码来源:main-modules.php
示例11: delete_image
function delete_image($path, $image_name)
{
//images to delete
$items = array(get_thumbnail($image_name), $image_name);
//delete only if exists
foreach ($items as $item) {
if (check_image_existance($path, $item)) {
unlink($path . $item);
}
}
}
开发者ID:newwavetechug,项目名称:gpp,代码行数:11,代码来源:killerfunctions_helper.php
示例12: base_url
<div class="form-group">
<div class="col-sm-9">
<div class="fileinput fileinput-new" data-provides="fileinput">
<div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;">
<?php
//if there is an image
if (get_blog_article_info_by_id($id, 'image'))
{
?>
<img
src="<?= base_url() . 'uploads/blogs/' . get_thumbnail(get_blog_article_info_by_id($id, 'image')) ?>">
<?php
}
?>
</div>
<div>
<?php
$data = array
(
'name' => 'userfile',
'id' => 'userfile',
'value' => set_value('userfile'),
'maxlength' => '',
'size' => '',
开发者ID:rmuyinda,项目名称:dms-1,代码行数:27,代码来源:change_blog_cover_f.php
示例13: array
<?php
$testimonials_args = array('post_type' => array('testimonial'), 'showposts' => '1', 'orderby' => 'rand');
$testimonials_query = new WP_Query($testimonials_args);
while ($testimonials_query->have_posts()) {
$testimonials_query->the_post();
?>
<div class="testimonials-item">
<div class="testimonials-item-bottom">
<div class="testimonials-item-content">
<?php
$thumb = '';
$width = 56;
$height = 56;
$classtext = 'item-image';
$titletext = get_the_title();
$thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Testimonial');
$thumb = $thumbnail["thumb"];
?>
<?php
if ($thumb != '') {
?>
<div class="thumb">
<?php
print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
?>
<span class="overlay"></span>
</div> <!-- end .thumb -->
<?php
}
?>
<p class="author"><?php
开发者ID:Bobcatou,项目名称:lakemillsyoga,代码行数:31,代码来源:home.php
示例14: et_fable_get_background
function et_fable_get_background()
{
if (has_post_format('gallery')) {
return '';
}
$style = '';
$post_bg_color = ($bg_color = get_post_meta(get_the_ID(), '_et_post_bg_color', true)) && '' !== $bg_color ? $bg_color : '#ffffff';
$post_use_bg_color = 'on' === get_post_meta(get_the_ID(), '_et_use_bg_color', true) ? true : false;
$background = array();
$thumb = '';
$width = (int) apply_filters('et_blog_image_width', 9999);
$height = (int) apply_filters('et_blog_image_height', 9999);
$classtext = '';
$titletext = get_the_title();
$thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Indeximage');
$thumb = $thumbnail["thumb"];
// Gallery posts use featured image for the picture in the video container
// so don't allow it to use the featured image for background
if ('' !== $thumb && !has_post_format('video')) {
$background['image'] = $thumb;
}
if (isset($background['image'])) {
$style = sprintf(' style="background-image: url(%s);"', esc_attr($background['image']));
}
// Attaches solid background color to the post if the featured image is not set
// or 'Background Color instead of the Featured Image' is enabled
if ('' === $style || $post_use_bg_color) {
$style = sprintf(' style="background-color: %s;"', esc_attr($post_bg_color));
}
return $style;
}
开发者ID:iinspiration,项目名称:theme,代码行数:31,代码来源:functions.php
示例15: get_template_part
<?php
get_template_part('includes/breadcrumbs', 'single');
?>
<?php
while (have_posts()) {
the_post();
?>
<div class="et-map-post">
<?php
$thumb = '';
$width = (int) apply_filters('et_single_listing_image_width', 960);
$height = (int) apply_filters('et_single_listing_image_height', 320);
$classtext = '';
$titletext = get_the_title();
$thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'ListingSingle');
$thumb = $thumbnail["thumb"];
?>
<?php
if ('' != $thumb) {
?>
<div class="thumbnail">
<?php
print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
?>
<div class="et-description">
<h1><?php
the_title();
?>
</h1>
开发者ID:iinspiration,项目名称:theme,代码行数:31,代码来源:single-listing.php
示例16: shortcode_callback
function shortcode_callback($atts, $content = null, $function_name)
{
$module_id = $this->shortcode_atts['module_id'];
$module_class = $this->shortcode_atts['module_class'];
$fullwidth = $this->shortcode_atts['fullwidth'];
$posts_number = $this->shortcode_atts['posts_number'];
$include_categories = $this->shortcode_atts['include_categories'];
$meta_date = $this->shortcode_atts['meta_date'];
$show_thumbnail = $this->shortcode_atts['show_thumbnail'];
$show_content = $this->shortcode_atts['show_content'];
$show_author = $this->shortcode_atts['show_author'];
$show_date = $this->shortcode_atts['show_date'];
$show_categories = $this->shortcode_atts['show_categories'];
$show_comments = $this->shortcode_atts['show_comments'];
$show_pagination = $this->shortcode_atts['show_pagination'];
$background_layout = $this->shortcode_atts['background_layout'];
$show_more = $this->shortcode_atts['show_more'];
$offset_number = $this->shortcode_atts['offset_number'];
$masonry_tile_background_color = $this->shortcode_atts['masonry_tile_background_color'];
$use_dropshadow = $this->shortcode_atts['use_dropshadow'];
global $paged;
$module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
$container_is_closed = false;
if ('' !== $masonry_tile_background_color) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_blog_grid .et_pb_post', 'declaration' => sprintf('background-color: %1$s;', esc_html($masonry_tile_background_color))));
}
if ('on' !== $fullwidth) {
if ('on' === $use_dropshadow) {
$module_class .= ' et_pb_blog_grid_dropshadow';
}
wp_enqueue_script('salvattore');
$background_layout = 'light';
}
$args = array('posts_per_page' => (int) $posts_number);
$et_paged = is_front_page() ? get_query_var('page') : get_query_var('paged');
if (is_front_page()) {
$paged = $et_paged;
}
if ('' !== $include_categories) {
$args['cat'] = $include_categories;
}
if (!is_search()) {
$args['paged'] = $et_paged;
}
if ('' !== $offset_number && !empty($offset_number)) {
/**
* Offset + pagination don't play well. Manual offset calculation required
* @see: https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination
*/
if ($paged > 1) {
$args['offset'] = ($et_paged - 1) * intval($posts_number) + intval($offset_number);
} else {
$args['offset'] = intval($offset_number);
}
}
if (is_single() && !isset($args['post__not_in'])) {
$args['post__not_in'] = array(get_the_ID());
}
ob_start();
query_posts($args);
if (have_posts()) {
while (have_posts()) {
the_post();
$post_format = et_pb_post_format();
$thumb = '';
$width = 'on' === $fullwidth ? 1080 : 400;
$width = (int) apply_filters('et_pb_blog_image_width', $width);
$height = 'on' === $fullwidth ? 675 : 250;
$height = (int) apply_filters('et_pb_blog_image_height', $height);
$classtext = 'on' === $fullwidth ? 'et_pb_post_main_image' : '';
$titletext = get_the_title();
$thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Blogimage');
$thumb = $thumbnail["thumb"];
$no_thumb_class = '' === $thumb || 'off' === $show_thumbnail ? ' et_pb_no_thumb' : '';
if (in_array($post_format, array('video', 'gallery'))) {
$no_thumb_class = '';
}
?>
<article id="post-<?php
the_ID();
?>
" <?php
post_class('et_pb_post' . $no_thumb_class);
?>
>
<?php
et_divi_post_format_content();
if (!in_array($post_format, array('link', 'audio', 'quote'))) {
if ('video' === $post_format && false !== ($first_video = et_get_first_video())) {
printf('<div class="et_main_video_container">
%1$s
</div>', $first_video);
} elseif ('gallery' === $post_format) {
et_gallery_images();
} elseif ('' !== $thumb && 'on' === $show_thumbnail) {
if ('on' !== $fullwidth) {
echo '<div class="et_pb_image_container">';
}
//.........这里部分代码省略.........
开发者ID:acchs,项目名称:test,代码行数:101,代码来源:main-modules.php
示例17: get_thumbnail
?>
<?php
if (!empty($p->quote)) {
?>
<div class="featured-quote">
<blockquote><?php
echo $p->quote;
?>
</blockquote>
</div>
<?php
}
?>
<div class="teaser-body" itemprop="articleBody">
<?php
echo get_thumbnail($p->body);
?>
<?php
echo get_teaser($p->body, $p->url);
?>
<?php
if (config('teaser.type') === 'trimmed') {
?>
<a href="<?php
echo $p->url;
?>
">Read more</a><?php
}
?>
</div>
</div>
开发者ID:austinvernsonger,项目名称:htmly,代码行数:31,代码来源:main.html.php
示例18: encryptValue
<a target="_blank" id="<?= encryptValue($row['id']) ?>" href="<?=$row['footer_link']?>" class="context-menu-one box menu-1">
<?= ($row['footer_link']); ?> <i class="md md-link"></i>
</a>
</td>
<td>
<?php
if($row['imageurl']){
?>
<a href="<?= base_url() . 'uploads/footer_link_logos/' . $row['imageurl'] ?>"
class="fancybox" title="<?= $row['title'] ?>">
<img class="img-circle" width="32px" height="32px"
src="<?= base_url() ?>uploads/footer_link_logos/<?= get_thumbnail($row['imageurl']) ?>">
</a>
<?php
}
?>
<a href="<?=base_url().$this->uri->segment(1).'/'.$this->uri->segment(2).'/footer_link_logo/'.encryptValue($row['id'])?>"><?=$row['imageurl']!==''?'update':'upload'?> Logo</a> </td>
</tr>
<?php
}
?>
开发者ID:rmuyinda,项目名称:dms-1,代码行数:30,代码来源:footer_links_home_v.php
示例19: array
$et_featured_pages_args = array('post_type' => 'page', 'orderby' => 'menu_order', 'order' => 'DESC', 'posts_per_page' => (int) $featured_num);
if (is_array(et_get_option('mycuisine_feat_pages', '', 'page'))) {
$et_featured_pages_args['post__in'] = (array) array_map('intval', et_get_option('mycuisine_feat_pages', '', 'page'));
}
query_posts($et_featured_pages_args);
}
while (have_posts()) {
the_post();
global $post;
$et_mycuisine_settings = maybe_unserialize(get_post_meta(get_the_ID(), '_et_mycuisine_settings', true));
$arr[$i]['variation'] = isset($et_mycuisine_settings['et_fs_variation']) ? (int) $et_mycuisine_settings['et_fs_variation'] : 1;
$arr[$i]["title"] = truncate_title(25, false);
$arr[$i]["fulltitle"] = truncate_title(250, false);
$arr[$i]["excerpt"] = isset($et_mycuisine_settings['et_fs_custom_excerpt']) ? $et_mycuisine_settings['et_fs_custom_excerpt'] : truncate_post(180, false);
$arr[$i]["permalink"] = isset($et_mycuisine_settings['et_fs_link']) && !empty($et_mycuisine_settings['et_fs_link']) ? $et_mycuisine_settings['et_fs_link'] : get_permalink();
$arr[$i]["thumbnail"] = get_thumbnail($width, $height, '', $arr[$i]["fulltitle"], $arr[$i]["fulltitle"], true, 'Featured');
$arr[$i]["thumb"] = $arr[$i]["thumbnail"]["thumb"];
$arr[$i]["use_timthumb"] = $arr[$i]["thumbnail"]["use_timthumb"];
$arr[$i]["color"] = isset($et_mycuisine_settings['et_fs_bgcolor']) ? $et_mycuisine_settings['et_fs_bgcolor'] : '452917';
$arr[$i]["color"] = str_replace('#', '', $arr[$i]["color"]);
$arr[$i]["moretext"] = isset($et_mycuisine_settings['et_fs_button']) && !empty($et_mycuisine_settings['et_fs_button']) ? $et_mycuisine_settings['et_fs_button'] : 'Read More';
$arr[$i]['post_id'] = (int) get_the_ID();
$i++;
}
wp_reset_query();
?>
<?php
for ($i = 1; $i <= $featured_num; $i++) {
?>
<div class="slide<?php
开发者ID:javierdlahoz,项目名称:paella-development,代码行数:31,代码来源:featured.php
示例20: shortcode_callback
function shortcode_callback($atts, $content = null, $function_name)
{
/**
* Cached $wp_filter so it can be restored at the end of the callback.
* This is needed because this callback uses the_content filter / calls a function
* which uses the_content filter. WordPress doesn't support nested filter
*/
global $wp_filter;
$wp_filter_cache = $wp_filter;
$module_id = $this->shortcode_atts['module_id'];
$module_class = $this->sh
|
请发表评论