本文整理汇总了PHP中aq_resize函数的典型用法代码示例。如果您正苦于以下问题:PHP aq_resize函数的具体用法?PHP aq_resize怎么用?PHP aq_resize使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了aq_resize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: thb_teammember
function thb_teammember($atts, $content = null)
{
extract(shortcode_atts(array('image' => '', 'name' => '', 'position' => '', 'facebook' => '', 'twitter' => '', 'googleplus' => '', 'linkedin' => ''), $atts));
$out = '';
$img_id = preg_replace('/[^\\d]/', '', $image);
$img = wp_get_attachment_image_src($img_id, 'full');
$resized = aq_resize($img[0], 270, 270, true, false);
$out .= '<aside class="team_member">';
$out .= '<img src="' . $resized[0] . '" width="' . $resized[1] . '" height="' . $resized[2] . '" alt="' . $name . '" />';
$out .= $name ? '<strong>' . $name . '</strong>' : '';
$out .= $position ? '<small>' . $position . '</small>' : '';
if ($facebook || $googleplus || $twitter || $linkedin) {
$out .= '<div class="social_links">';
if ($facebook) {
$out .= '<a href="' . $facebook . '" class="facebook icon-2x"><i class="fa fa-facebook"></i></a>';
}
if ($twitter) {
$out .= '<a href="' . $twitter . '" class="twitter icon-2x"><i class="fa fa-twitter"></i></a>';
}
if ($googleplus) {
$out .= '<a href="' . $googleplus . '" class="google-plus icon-2x"><i class="fa fa-google-plus"></i></a>';
}
if ($linkedin) {
$out .= '<a href="' . $linkedin . '" class="linkedin icon-2x"><i class="fa fa-linkedin"></i></a>';
}
$out .= '</div>';
}
$out .= '</aside>';
return $out;
}
示例2: getCameraHTML
function getCameraHTML($slider_result)
{
$options = get_option($slider_result->option_name);
$html = '<div class="clearfix ut-slider-wrap"><div class="camera_white_skin cameraslider_' . $slider_result->id . ' camera_wrap">';
$z = 0;
if (is_array($options['slides'])) {
foreach ($options['slides'] as $slide) {
if ($slide['imgurl']) {
$html .= '<div data-thumb="' . aq_resize($slide['imgurl'], 50, 50, true) . '" data-src="' . $slide['imgurl'] . '">';
}
if (!$slide['imgurl']) {
$html .= '<div data-src="' . get_template_directory_uri() . '/images/blank.gif">';
}
if ($slide['video']) {
$html .= '<div class="caption_play"><a data-rel="prettySlider" href="' . extractURL($slide['video']) . '">PLAY</a></div>';
}
if ($slide['caption_desc'] || $slide['caption_text']) {
$html .= '<div class="camera_caption fadeIn"><div class="captionwrap"><div class="nevada-caption ' . $slide['caption_color'] . ' ' . $slide['caption_align'] . '"><h2>' . $slide['caption_text'] . '</h2>';
}
if ($slide['caption_desc']) {
$html .= '<p>' . $slide['caption_desc'] . '</p>';
}
if ($slide['buttontext']) {
$html .= '<a href="' . $slide['caption_link'] . '" class="excerpt">' . $slide['buttontext'] . '</a>';
}
if ($slide['caption_desc'] || $slide['caption_text']) {
$html .= '</div></div></div>';
}
$html .= '</div>';
$z++;
}
}
$html .= '</div></div>';
return $html;
}
示例3: thb_teammember
function thb_teammember($atts, $content = null)
{
extract(shortcode_atts(array('image' => '', 'name' => '', 'position' => '', 'text' => '', 'advanced' => false, 'facebook' => '', 'twitter' => '', 'pinterest' => '', 'linkedin' => ''), $atts));
$out = '';
$img_id = preg_replace('/[^\\d]/', '', $image);
$img = wp_get_attachment_image_src($img_id, 'full');
$resized = aq_resize($img[0], 320, 340, true, false, true);
$out .= '<aside class="team_member">';
$out .= '<figure class="fresco">';
$out .= '<img src="' . $resized[0] . '" width="' . $resized[1] . '" height="' . $resized[2] . '" alt="' . $name . '" />';
$out .= '<div class="overlay"><div class="buttons ' . ($advanced ? 'advanced' : '') . '">';
$out .= $name ? '<h5>' . $name . '</h5>' : '';
$out .= $position ? '<h6>' . $position . '</h6>' : '';
if ($facebook || $pinterest || $twitter || $linkedin) {
$out .= '<div class="social_links">';
if ($facebook) {
$out .= '<a href="' . $facebook . '" class="facebook"><i class="fa fa-facebook"></i></a>';
}
if ($twitter) {
$out .= '<a href="' . $twitter . '" class="twitter"><i class="fa fa-twitter"></i></a>';
}
if ($pinterest) {
$out .= '<a href="' . $pinterest . '" class="pinterest"><i class="fa fa-pinterest"></i></a>';
}
if ($linkedin) {
$out .= '<a href="' . $linkedin . '" class="linkedin"><i class="fa fa-linkedin"></i></a>';
}
$out .= '</div>';
}
$out .= '</div></div>';
$out .= '</figure>';
$out .= '</aside>';
return $out;
}
示例4: thb_slider
function thb_slider($atts, $content = null)
{
extract(shortcode_atts(array('images' => '', 'width' => '1170', 'height' => '540', 'bullets' => '', 'navigation' => ''), $atts));
$images = explode(',', $images);
ob_start();
$nav = $navigation == 'true' ? 'true' : 'false';
$bul = $bullets == 'true' ? 'true' : 'false';
?>
<div class="carousel-container bottom-pagination">
<div class="carousel owl" data-columns="1" data-navigation="<?php
echo $nav;
?>
" data-pagination="<?php
echo $bul;
?>
">
<?php
foreach ($images as $image) {
$image_link = wp_get_attachment_image_src($image, 'full');
$image_src = aq_resize($image_link[0], $width, $height, true, false, true);
$image_title = get_post($image)->post_excerpt;
?>
<figure class="wp-caption">
<img src="<?php
echo $image_src[0];
?>
" width="<?php
echo $image_src[1];
?>
" height="<?php
echo $image_src[2];
?>
" alt="<?php
echo $image_title;
?>
" />
<?php
if ($image_title) {
?>
<p class="wp-caption-text"><?php
echo $image_title;
?>
</p>
<?php
}
?>
</figure>
<?php
}
?>
</div>
</div>
<?php
$out = ob_get_contents();
if (ob_get_contents()) {
ob_end_clean();
}
return $out;
}
示例5: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', $instance['title']);
$number = apply_filters('widget_number', $instance['number']);
$order = apply_filters('widget_order', $instance['order']);
$post_type = apply_filters('widget_post_type', $instance['post_type']);
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
?>
<ul class="wpex-widget-recent-posts">
<?php
global $post;
$args = array('post_type' => $post_type, 'numberposts' => $number, 'orderby' => $order, 'no_found_rows' => true);
$myposts = get_posts($args);
foreach ($myposts as $post) {
setup_postdata($post);
if (has_post_thumbnail()) {
?>
<li class="clearfix wpex-widget-recent-posts-li">
<a href="<?php
the_permalink();
?>
" title="<?php
the_title();
?>
" class="wpex-widget-recent-posts-thumbnail"><img src="<?php
echo aq_resize(wp_get_attachment_url(get_post_thumbnail_id()), 65, 65, true);
?>
" alt="<?php
the_title();
?>
" /></a>
<a href="<?php
the_permalink();
?>
" title="<?php
the_title();
?>
" class="wpex-widget-recent-posts-title"><?php
the_title();
?>
</a>
<div class="wpex-widget-recent-posts-date"><?php
echo get_the_date();
?>
</div>
</li>
<?php
}
}
wp_reset_postdata();
?>
</ul>
<?php
echo $after_widget;
}
示例6: resize_thumbnail_by_url
/**
* The Featured Thumbnail
*
* @since 1.0.0
*/
function resize_thumbnail_by_url($url, $title, $width, $height, $crop)
{
if (function_exists('aq_resize')) {
$thumbnail = aq_resize($url, $width, $height, $crop, false);
$html = '<img width="' . $thumbnail[1] . '" height="' . $thumbnail[2] . '" src="' . $thumbnail[0] . '" alt="' . $title . '" title="' . $title . '" />';
return $html;
}
}
示例7: resizeByRatio
public function resizeByRatio($ratio)
{
if (is_string($ratio)) {
$ratioArr = explode(':', $ratio);
$ratio = $ratioArr[0] / $ratioArr[1];
}
return \aq_resize($this->image->url, $this->image->width, round($ratio * $this->image->width), true);
}
示例8: vntd_thumb
function vntd_thumb($w, $h = null)
{
require_once dirname(__FILE__) . '/../../includes/aq_resizer.php';
global $post;
$imgurl = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'thumbnail');
return $imgurl[0];
return aq_resize($imgurl[0], $w, $h, true);
}
示例9: waxom_thumb
function waxom_thumb($w, $h = null)
{
require_once get_template_directory() . '/includes/aq_resizer.php';
global $post;
$imgurl = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'thumbnail');
return $imgurl[0];
return aq_resize($imgurl[0], $w, $h, true);
}
示例10: woocommerce_template_loop_product_thumbnail
function woocommerce_template_loop_product_thumbnail()
{
global $post;
$details = get_option('shop_catalog_image_size');
$url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
$resized_image = aq_resize($url[0], $details['width'], $details['height'], $details['crop']);
echo '<a href="' . get_permalink() . '"><img src="' . $resized_image . '" alt="' . get_the_title() . '" /></a>';
}
示例11: content
protected function content($atts, $content = null)
{
$title = $width = $el_class = $output = $tax_terms = $filter = $items = $el_position = '';
extract(shortcode_atts(array('title' => '', 'item_count' => '-1', 'category' => '', 'pagination' => 'no', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
// CATEGORY SLUG MODIFICATION
if ($category == "All") {
$category = "all";
}
if ($category == "all") {
$category = '';
}
$category_slug = str_replace('_', '-', $category);
// CLIENTS QUERY SETUP
global $post, $wp_query;
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$client_args = array('post_type' => 'clients', 'post_status' => 'publish', 'paged' => $paged, 'clients-category' => $category_slug, 'posts_per_page' => $item_count);
$clients_items = new WP_Query($client_args);
$items .= '<ul class="clients-items clearfix">';
$client_width = 135;
$client_height = 135;
// CLIENTS LOOP
while ($clients_items->have_posts()) {
$clients_items->the_post();
$client_image = get_post_thumbnail_id();
$client_img_url = wp_get_attachment_url($client_image, 'full');
$client_link_url = get_post_meta($post->ID, 'sf_client_link', true);
$items .= '<li class="clearfix client-item">';
$items .= '<figure>';
$image = aq_resize($client_img_url, $client_width, $client_height, true, false);
if ($image) {
if ($client_link_url) {
$items .= '<a href="' . $client_link_url . '"><img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" /></a>';
} else {
$items .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" />';
}
}
$items .= '</figure>';
}
wp_reset_postdata();
$items .= '</ul>';
// PAGINATION
if ($pagination == "yes") {
$items .= '<div class="pagination-wrap full-width">';
$items .= pagenavi($clients_items);
$items .= '</div>';
}
// PAGE BUILDER OUPUT
$el_class = $this->getExtraClass($el_class);
$width = wpb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="wpb_clients_widget wpb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="wpb_wrapper clients-wrap">';
$output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h3 class="wpb_heading wpb_text_heading">' . $title . '</h3></div>' : '';
$output .= "\n\t\t\t\t" . $items;
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
return $output;
}
示例12: ajax_load_portfolio
function ajax_load_portfolio()
{
$ST_core = new ST_core();
global $wpdb;
global $post;
$number = $_POST['number'];
$currFilter = $_POST['currFilter'];
$portfolio_column = $_POST['portfolio_column'];
$args = array('post_type' => 'portfolio', 'posts_per_page' => $number);
//$query_post = $wpdb->get_results("SELECT * FROM `posts` WHERE `post_type` LIKE 'portfolio'");
$query_post = new WP_Query($args);
$html = '';
$counter = 0;
$array_portfolio_info = "";
if ($query_post->have_posts()) {
while ($query_post->have_posts()) {
$query_post->the_post();
$post_term = get_the_terms($post->ID, 'categories-portfolio');
$currFilter = ltrim($currFilter, '.');
if ($post_term) {
$class_por = "";
$i = 0;
foreach ($post_term as $termp) {
$class_por .= $termp->slug . ' ';
if ($currFilter == $termp->slug) {
$i = $i + 1;
}
}
}
//$currFilter_class = '';if($i == 'filtered') { $currFilter_class = 'filtered';}
//print_r($post_term);
$thumb = wp_get_attachment_image_src(get_post_thumbnail_id($query_post->post->ID), 'large');
$url = $thumb['0'];
$resize = aq_resize($url, 555, 300, true, true, true);
$html .= '<article class="' . $portfolio_column . ' col-sm-6 project-item ' . $class_por . ' ';
if ($i == 0) {
$html .= 'filtered';
}
$html .= ' in">';
$html .= '<div class="project-thumb in">';
$html .= '<a href="#" class="main-link">';
$html .= '<img class="img-responsive img-center" src="' . $resize . '" alt="">';
$html .= '<h2 class="project-title">' . get_the_title() . '</h2>';
$html .= '<span class="overlay-mask"></span>';
$html .= '</a>';
$html .= '<a class="enlarge cboxElement" href="' . $url . '" title="' . get_the_title() . '"><i class="fa fa-expand fa-fw"></i></a>';
$html .= '<a class="link" href="' . get_permalink() . '"><i class="fa fa-eye fa-fw"></i></a>';
$html .= '</div>';
$html .= '</article>';
$array_portfolio_info[$counter] = array(0 => get_the_title(), 1 => $url);
$counter = $counter + 1;
}
}
wp_reset_query();
//echo $html;
echo json_encode(array('massage' => apply_filters('filter_portfolio_azax_backend', $html)), JSON_HEX_QUOT | JSON_HEX_TAG);
die;
}
示例13: content
protected function content($atts, $content = null)
{
$title = $width = $el_class = $output = $filter = $items = $el_position = '';
extract(shortcode_atts(array('title' => '', "item_count" => '12', "category" => '', 'pagination' => '', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
// CATEGORY SLUG MODIFICATION
if ($category == "All") {
$category = "all";
}
if ($category == "all") {
$category = '';
}
$category_slug = str_replace('_', '-', $category);
global $post, $wp_query;
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$team_args = array('post_type' => 'team', 'post_status' => 'publish', 'paged' => $paged, 'team-category' => $category_slug, 'posts_per_page' => $item_count, 'ignore_sticky_posts' => 1);
$team_members = new WP_Query($team_args);
$count = 0;
$items .= '<ul class="team-members clearfix">';
while ($team_members->have_posts()) {
$team_members->the_post();
$member_name = get_the_title();
$member_position = get_post_meta($post->ID, 'sf_team_member_position', true);
$member_image = get_post_thumbnail_id();
$member_page_link = get_permalink();
$items .= '<li data-id="id-' . $count . '" class="clearfix team-member four columns">';
$img_url = wp_get_attachment_url($member_image, 'full');
$image = aq_resize($img_url, 220, 298, true, false);
$items .= '<figure>';
if ($image) {
$items .= '<a href="' . $member_page_link . '"><img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $member_name . '" /></a>';
}
$items .= '</figure>';
$items .= '<h4 class="team-member-name">' . $member_name . '</h4>';
$items .= '<h5 class="team-member-position">' . $member_position . '</h5>';
$items .= '<a class="read-more" href="' . $member_page_link . '">' . __("Find out more", "swiftframework") . '<i class="icon-chevron-right"></i></a>';
$items .= '</li>';
$count++;
}
wp_reset_postdata();
$items .= '</ul>';
// PAGINATION
if ($pagination == "yes") {
$items .= '<div class="pagination-wrap full-width">';
$items .= pagenavi($team_members);
$items .= '</div>';
}
$el_class = $this->getExtraClass($el_class);
$width = wpb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="team_list_widget wpb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="wpb_wrapper">';
$output .= $title != '' ? "\n\t\t\t" . '<h3 class="wpb_heading">' . $title . '</h3>' : '';
$output .= "\n\t\t\t\t" . $items;
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
return $output;
}
示例14: coupon_new_home_coupons_list
function coupon_new_home_coupons_list($category_id, $thumb, $discount, $date, $daysleft)
{
?>
<li class="coupon_new_li">
<a href="<?php
echo get_category_link($category_id);
?>
" class="coupon_new_link">
<div class="coupon_new_wrapper">
<div class="coupon_new_logo" >
<img class="coupon_new_logo_img" src="<?php
echo aq_resize($thumb, 75, 60, true);
?>
" alt="<?php
the_title();
?>
">
</div>
<div class="coupon_new_text">
<div class="coupon_new_title">
<h2 class="coupon_title_font" style="margin:0;"><?php
truncate_title(38);
?>
</h2>
</div>
<!--Change: New Font for class 13.11.2015-->
<div class="coupon_new_discount">
<?php
if ($discount != '') {
?>
<span class="value secondary"><?php
echo $discount;
?>
</span>
<?php
}
?>
<span class="coupon_new_expire">
<?php
if ($date == '') {
_e('有效', 'Couponize');
} else {
if ($daysleft <= 0) {
_e('已过期', 'Couponize');
} else {
echo sprintf(_n('%d天后过期', '%d天后过期', $daysleft, 'Couponize'), $daysleft);
}
}
?>
</span>
</div>
</div>
</div>
</a>
</li>
<?php
}
示例15: getUserImage
function getUserImage($dimension)
{
if (class_exists('Aq_Resize')) {
$image = \get_field('quan_userimage', 'user_' . $this->user->ID);
if (!empty($image)) {
$resized = \aq_resize($image['url'], $dimension, $dimension, true);
return $resized ? $resized : $image['url'];
}
}
}