本文整理汇总了PHP中dslc_aq_resize函数的典型用法代码示例。如果您正苦于以下问题:PHP dslc_aq_resize函数的具体用法?PHP dslc_aq_resize怎么用?PHP dslc_aq_resize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dslc_aq_resize函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: output
//.........这里部分代码省略.........
$thumb_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
$thumb_url = $thumb_url[0];
$thumb_alt = get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true);
if (!$thumb_alt) {
$thumb_alt = '';
}
$resize_width = false;
$resize_height = false;
if (isset($options['thumb_resize_width_manual']) && !empty($options['thumb_resize_width_manual'])) {
$resize_width = $options['thumb_resize_width_manual'];
}
if (isset($options['thumb_resize_height']) && !empty($options['thumb_resize_height'])) {
$resize_height = $options['thumb_resize_height'];
}
}
?>
<?php
if (has_post_thumbnail()) {
?>
<div class="dslc-post-thumb dslc-project-thumb dslc-on-hover-anim">
<div class="dslc-project-thumb-inner dslca-post-thumb">
<?php
if ($manual_resize) {
?>
<a href="<?php
echo $the_project_url;
?>
" target="<?php
echo $the_project_url_target;
?>
"><img src="<?php
$res_img = dslc_aq_resize($thumb_url, $resize_width, $resize_height, true);
echo $res_img;
?>
" alt="<?php
echo $thumb_alt;
?>
" /></a>
<?php
} else {
?>
<a href="<?php
echo $the_project_url;
?>
" target="<?php
echo $the_project_url_target;
?>
"><?php
the_post_thumbnail('full');
?>
</a>
<?php
}
?>
</div><!-- .dslc-project-thumb-inner -->
<?php
if (($options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible') && ($post_elements == 'all' || in_array('title', $post_elements) || in_array('categories', $post_elements) || in_array('excerpt', $post_elements) || in_array('button', $post_elements))) {
?>
<div class="dslc-project-main <?php
if ($options['main_location'] == 'inside_visible') {
echo 'dslc-project-main-visible';
}
示例2: output
//.........这里部分代码省略.........
?>
<?php
if (has_post_thumbnail()) {
?>
<?php
$anchor_class = 'dslc-lightbox-image';
$duration_hover = '';
$value_duration = $options['css_main_bg_color_duration_hover'];
if ($value_duration != '') {
$duration_hover = 'style="-webkit-transition: all ' . $value_duration . 'ms ease-out;-moz-transition: all ' . $value_duration . 'ms ease-out;-ms-transition: all ' . $value_duration . 'ms ease-out;-o-transition: all ' . $value_duration . 'ms ease-out;transition: all ' . $value_duration . 'ms ease-out;"';
}
?>
<div class="dslc-post-thumb dslc-project-thumb dslc-on-hover-anim as-project-custom">
<div class="dslc-project-thumb-inner dslca-post-thumb">
<?php
if ($manual_resize) {
?>
<a data-id="<?php
echo get_the_ID();
?>
" data-ajax="<?php
echo isset($options['as_ajax_projects']) && $options['as_ajax_projects'] ? '1' : '0';
?>
" href="<?php
echo $the_project_url;
?>
" target="<?php
echo $the_project_url_target;
?>
"><img src="<?php
$res_img = dslc_aq_resize($thumb_url, $resize_width, $resize_height, true);
echo $res_img;
?>
" alt="<?php
echo $thumb_alt;
?>
" /></a>
<?php
} else {
?>
<a data-id="<?php
echo get_the_ID();
?>
" data-ajax="<?php
echo isset($options['as_ajax_projects']) && $options['as_ajax_projects'] ? '1' : '0';
?>
" href="<?php
echo $the_project_url;
?>
" target="<?php
echo $the_project_url_target;
?>
"><?php
the_post_thumbnail('full');
?>
</a>
<?php
}
?>
</div><!-- .dslc-project-thumb-inner -->
<?php
示例3: output
//.........这里部分代码省略.........
if (isset($options['thumb_resize_height']) && !empty($options['thumb_resize_height']) || isset($options['thumb_resize_width_manual']) && !empty($options['thumb_resize_width_manual'])) {
$manual_resize = true;
$thumb_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
$thumb_url = $thumb_url[0];
$thumb_alt = get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true);
if (!$thumb_alt) {
$thumb_alt = '';
}
$resize_width = false;
$resize_height = false;
if (isset($options['thumb_resize_width_manual']) && !empty($options['thumb_resize_width_manual'])) {
$resize_width = $options['thumb_resize_width_manual'];
}
if (isset($options['thumb_resize_height']) && !empty($options['thumb_resize_height'])) {
$resize_height = $options['thumb_resize_height'];
}
}
?>
<?php
if (has_post_thumbnail()) {
?>
<div class="dslc-blog-post-thumb dslc-post-thumb dslc-on-hover-anim">
<div class="dslc-blog-post-thumb-inner dslca-post-thumb">
<?php
if ($manual_resize) {
?>
<a href="<?php
the_permalink();
?>
"><img src="<?php
$res_img = dslc_aq_resize($thumb_url, $resize_width, $resize_height, true);
echo $res_img;
?>
" alt="<?php
echo $thumb_alt;
?>
" /></a>
<?php
} else {
?>
<a href="<?php
the_permalink();
?>
"><?php
the_post_thumbnail('full');
?>
</a>
<?php
}
?>
</div><!-- .dslc-blog-post-thumb-inner -->
<?php
if (($options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible') && ($post_elements == 'all' || in_array('title', $post_elements) || in_array('meta', $post_elements) || in_array('excerpt', $post_elements) || in_array('button', $post_elements))) {
?>
<div class="dslc-post-main dslc-blog-post-main <?php
if ($options['main_location'] == 'inside_visible') {
echo 'dslc-blog-post-main-visible';
}
?>
dslc-on-hover-anim-target dslc-anim-<?php
echo $options['css_anim_hover'];
示例4: output
//.........这里部分代码省略.........
/**
* Manual Resize
*/
$manual_resize = false;
if (isset($options['thumb_resize_height']) && !empty($options['thumb_resize_height']) || isset($options['thumb_resize_width_manual']) && !empty($options['thumb_resize_width_manual'])) {
$manual_resize = true;
$thumb_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
$thumb_url = $thumb_url[0];
$resize_width = false;
$resize_height = false;
if (isset($options['thumb_resize_width_manual']) && !empty($options['thumb_resize_width_manual'])) {
$resize_width = $options['thumb_resize_width_manual'];
}
if (isset($options['thumb_resize_height']) && !empty($options['thumb_resize_height'])) {
$resize_height = $options['thumb_resize_height'];
}
}
?>
<?php
if (has_post_thumbnail()) {
?>
<div class="dslc-post-thumb dslc-cpt-post-thumb dslc-on-hover-anim">
<div class="dslc-cpt-post-thumb-inner dslca-post-thumb">
<?php
if ($manual_resize) {
?>
<a href="<?php
the_permalink();
?>
"><img src="<?php
$res_img = dslc_aq_resize($thumb_url, $resize_width, $resize_height, true);
echo $res_img;
?>
" /></a>
<?php
} else {
?>
<a href="<?php
the_permalink();
?>
"><?php
the_post_thumbnail('full');
?>
</a>
<?php
}
?>
</div><!-- .dslc-cpt-post-thumb-inner -->
<?php
if (($options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible') && ($post_elements == 'all' || in_array('title', $post_elements) || in_array('meta', $post_elements) || in_array('excerpt', $post_elements) || in_array('button', $post_elements))) {
?>
<div class="dslc-post-main dslc-cpt-post-main <?php
if ($options['main_location'] == 'inside_visible') {
echo 'dslc-cpt-post-main-visible';
}
?>
dslc-on-hover-anim-target dslc-anim-<?php
echo $options['css_anim_hover'];
?>
" data-dslc-anim="<?php
echo $options['css_anim_hover'];
示例5: output
function output($options)
{
$this->module_start($options);
/* Module output starts here */
global $dslc_active;
if ($dslc_active && is_user_logged_in() && current_user_can(DS_LIVE_COMPOSER_CAPABILITY)) {
$dslc_is_admin = true;
} else {
$dslc_is_admin = false;
}
$anchor_class = '';
$anchor_target = '_self';
$anchor_href = '#';
if ($options['link_type'] == 'url_new') {
$anchor_target = '_blank';
}
if ($options['link_url'] !== '') {
$anchor_href = do_shortcode($options['link_url']);
}
if ($options['link_type'] == 'lightbox' && $options['link_lb_image'] !== '') {
$anchor_class .= 'dslc-lightbox-image ';
$anchor_href = $options['link_lb_image'];
}
?>
<div class="dslc-image">
<?php
if (empty($options['image']) && empty($options['image_url'])) {
?>
<div class="dslc-notification dslc-red"><?php
_e('No image has been set yet, edit the module to set one.', 'dslc_string');
?>
</div>
<?php
} else {
?>
<?php
$resize = false;
$the_image = $options['image'];
if (empty($options['image'])) {
$the_image = do_shortcode($options['image_url']);
} else {
if ($options['resize_width'] != '' || $options['resize_height'] != '') {
$resize = true;
$resize_width = false;
$resize_height = false;
if ($options['resize_width'] != '') {
$resize_width = $options['resize_width'];
}
if ($options['resize_height'] != '') {
$resize_height = $options['resize_height'];
}
$the_image = dslc_aq_resize($options['image'], $resize_width, $resize_height, true);
}
}
?>
<?php
if ($options['link_type'] !== 'none') {
?>
<a class="<?php
echo $anchor_class;
?>
" href="<?php
echo $anchor_href;
?>
" target="<?php
echo $anchor_target;
?>
">
<?php
}
?>
<img src="<?php
echo $the_image;
?>
" alt="<?php
echo $options['image_alt'];
?>
" title="<?php
echo $options['image_title'];
?>
" />
<?php
if ($options['link_type'] !== 'none') {
?>
</a>
<?php
}
?>
<?php
if ($options['custom_text_state'] == 'enabled') {
?>
<div class="dslc-image-caption">
//.........这里部分代码省略.........
示例6: widget
function widget($args, $instance)
{
$cache = array();
if (!$this->is_preview()) {
$cache = wp_cache_get('widget_cocktail_recent_posts', 'widget');
}
if (!is_array($cache)) {
$cache = array();
}
if (!isset($args['widget_id'])) {
$args['widget_id'] = $this->id;
}
if (isset($cache[$args['widget_id']])) {
echo $cache[$args['widget_id']];
return;
}
ob_start();
extract($args);
$title = !empty($instance['title']) ? $instance['title'] : __('Recent Posts', AS_DOMAIN);
/** This filter is documented in wp-includes/default-widgets.php */
$title = apply_filters('widget_title', $title, $instance, $this->id_base);
$number = !empty($instance['number']) ? absint($instance['number']) : 5;
if (!$number) {
$number = 5;
}
$show_date = isset($instance['show_date']) ? $instance['show_date'] : false;
$show_thumb = isset($instance['show_thumb']) ? $instance['show_thumb'] : false;
/**
* Filter the arguments for the Recent Posts widget.
*
* @since 3.4.0
*
* @see WP_Query::get_posts()
*
* @param array $args An array of arguments used to retrieve the recent posts.
*/
$r = new WP_Query(apply_filters('widget_posts_args', array('posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true)));
if ($r->have_posts()) {
echo $args['before_widget'];
if (!empty($title)) {
echo $args['before_title'] . $title . $args['after_title'];
}
?>
<ul class="recent-post-widget-wrapper">
<?php
while ($r->have_posts()) {
$r->the_post();
?>
<li>
<div class="recent-post-widget">
<?php
if (has_post_thumbnail()) {
?>
<?php
$thumbnail_src = wp_get_attachment_url(get_post_thumbnail_id());
$website_url = site_url();
$thumbnail_src = str_replace($website_url, '', $thumbnail_src);
$thumbnail = wp_get_attachment_url(get_post_thumbnail_id());
?>
<?php
if ($show_thumb) {
?>
<a href="<?php
the_permalink();
?>
" title="<?php
the_title();
?>
" class="as-img-thumb">
<img src="<?php
echo dslc_aq_resize($thumbnail, 70, 50, true);
?>
" alt="<?php
the_title();
?>
"/>
</a>
<?php
}
?>
<?php
}
?>
<div class="recent-post-widget-content">
<h5><a href="<?php
the_permalink();
?>
" class="sidebar-item-title"><?php
the_title();
?>
</a></h5>
<?php
if ($show_date) {
?>
<p class="recent-post-widget-date"><?php
_e('Posted:', AS_DOMAIN);
?>
<?php
echo human_time_diff(get_the_time('U'), current_time('timestamp')) . __(' ago', AS_DOMAIN);
?>
//.........这里部分代码省略.........
示例7: output
//.........这里部分代码省略.........
if ($post_elements == 'all' || in_array('thumbnail', $post_elements)) {
?>
<?php
/**
* Manual Resize
*/
$manual_resize = false;
if (isset($options['thumb_resize_height']) && !empty($options['thumb_resize_height']) || isset($options['thumb_resize_width_manual']) && !empty($options['thumb_resize_width_manual'])) {
$manual_resize = true;
$thumb_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
$thumb_url = $thumb_url[0];
$resize_width = false;
$resize_height = false;
if (isset($options['thumb_resize_width_manual']) && !empty($options['thumb_resize_width_manual'])) {
$resize_width = $options['thumb_resize_width_manual'];
}
if (isset($options['thumb_resize_height']) && !empty($options['thumb_resize_height'])) {
$resize_height = $options['thumb_resize_height'];
}
}
?>
<div class="dslc-post-thumb dslc-cpt-post-thumb dslc-on-hover-anim">
<div class="dslc-cpt-post-thumb-inner dslca-post-thumb">
<?php
if ($manual_resize) {
?>
<a href="<?php
the_permalink();
?>
"><img src="<?php
$res_img = dslc_aq_resize($thumb_url, $resize_width, $resize_height, true);
echo $res_img;
?>
" /></a>
<?php
} else {
?>
<a href="<?php
the_permalink();
?>
"><?php
the_post_thumbnail('full');
?>
</a>
<?php
}
?>
</div><!-- .dslc-cpt-post-thumb-inner -->
<?php
if (($options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible') && ($post_elements == 'all' || in_array('title', $post_elements) || in_array('meta', $post_elements) || in_array('excerpt', $post_elements) || in_array('button', $post_elements))) {
?>
<div class="dslc-post-main dslc-cpt-post-main <?php
if ($options['main_location'] == 'inside_visible') {
echo 'dslc-cpt-post-main-visible';
}
?>
dslc-on-hover-anim-target dslc-anim-<?php
echo $options['css_anim_hover'];
?>
" data-dslc-anim="<?php
echo $options['css_anim_hover'];