本文整理汇总了PHP中twoot_get_frontend_func函数的典型用法代码示例。如果您正苦于以下问题:PHP twoot_get_frontend_func函数的具体用法?PHP twoot_get_frontend_func怎么用?PHP twoot_get_frontend_func使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了twoot_get_frontend_func函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shortcode_image
function shortcode_image($atts, $content = null)
{
extract(shortcode_atts(array('title' => '', 'url' => '', 'width' => 460, 'height' => 245, 'crop' => 'yes', 'link' => '', 'lightbox' => 'yes'), $atts));
$_title = $title ? ' title="' . $title . '"' : '';
$crop = $crop == 'yes' ? true : false;
$html = '<div class="shortcode-image">';
$html .= '<div class="img img-hover">';
if ($link) {
$html .= '<a href="' . $link . '"' . $_title . '>';
$html .= twoot_get_frontend_func('resize_thumbnail_by_url', $url, $title, $width, $height, $crop);
$html .= '<div class="overlay"></div>';
$html .= '</a>';
} elseif ($lightbox == 'yes') {
$html .= '<a href="' . $url . '"' . $_title . ' class="fancybox-gallery">';
$html .= twoot_get_frontend_func('resize_thumbnail_by_url', $url, $title, $width, $height, $crop);
$html .= '<div class="overlay"></div>';
$html .= '</a>';
} else {
$html .= twoot_get_frontend_func('resize_thumbnail_by_url', $url, $title, $width, $height, $crop);
$html .= '<div class="overlay"></div>';
}
$html .= '</div>';
if ($title) {
$html .= '<div class="image-caption">' . $title . '</div>';
}
$html .= '</div>';
return $html;
}
示例2: shortcode_product_carousel
function shortcode_product_carousel($atts, $content = null)
{
extract(shortcode_atts(array('title' => 'Recent Products', 'type' => 'product_cat', 'counts' => '16', 'cats' => '', 'posts' => '', 'order' => 'DESC', 'orderby' => 'date', 'auto' => 'false', 'speed' => '800', 'pause' => '5000', 'move_slides' => '4'), $atts));
global $woocommerce;
$id = twoot_get_frontend_func('rand_num', 5);
if (!in_array($type, array('product_cat', 'product_tag'), true)) {
return $html = '<div class="the-not-posts">' . esc_attr__('Hi, please check the type option, the current type is not match!', 'Twoot_Toolkit') . '</div>';
}
// Get Query
$query = new Twoot_Query(array('counts' => $counts, 'cats' => $cats, 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'post_type' => 'product', 'taxonomy' => $type));
$products = new WP_Query($query->do_template_query());
if ($products->have_posts()) {
$html = '<div class="the-carousel-list the-product-list">';
$html .= '<h5 class="carousel-title">' . $title . '</h5>';
$html .= '<ul id="post-carousel-' . $id . '" class="products clearfix">';
while ($products->have_posts()) {
$products->the_post();
$html .= twoot_generator('load_template', 'loop-product-carousel');
}
wp_reset_query();
$html .= '</ul>';
$html .= '</div>';
$html .= twoot_generator('carousel_script', $id, $auto, $speed, $pause, $move_slides, $tag = 'd');
} else {
$html = '<div class="the-not-posts">' . esc_attr__('Hi, please check the type option, the current type is not match!', 'Twoot_Toolkit') . '</div>';
}
return $html;
}
示例3: shortcode_post_slider
function shortcode_post_slider($atts, $content = null)
{
extract(shortcode_atts(array('ids' => '', 'width' => '940', 'height' => '600', 'crop' => 'yes', 'lightbox' => 'yes', 'auto' => 'true', 'speed' => '800', 'pause' => '5000', 'mode' => 'fade'), $atts));
$ids = explode(',', $ids);
$crop = $crop == 'yes' ? true : false;
if (is_array($ids) && !empty($ids)) {
$count = 0;
$html = '<div class="shortcode-post-slider bx-slider">';
$html .= '<ul class="post-slider" data-auto="' . $auto . '" data-speed="' . $speed . '" data-pause="' . $pause . '" data-mode="' . $mode . '">';
foreach ($ids as $id) {
$count++;
$desc = trim(strip_tags(get_post($id)->post_content));
$caption = trim(strip_tags(get_post($id)->post_excerpt));
$tilte = $caption != false ? ' title="' . $caption . '"' : '';
$alt = trim(strip_tags(get_post_meta($id, '_wp_attachment_image_alt', true)));
$class = 'class="fancybox-gallery"';
$rel = count($ids) > 1 ? ' rel="gallery-' . get_the_ID() . '"' : '';
$html .= '<li class="img-preload img-hover">';
if ($lightbox == true) {
$html .= '<a href="' . twoot_get_frontend_func('thumbnail_url', $id) . '" ' . $class . $rel . $tilte . '>' . twoot_get_frontend_func('resize_thumbnail', $id, $caption, $width, $height, $crop) . '<div class="overlay"></div></a>';
} else {
$html .= twoot_get_frontend_func('resize_thumbnail', $id, $caption, $width, $height, $crop) . '<div class="overlay"></div>';
}
if ($caption) {
$html .= '<div class="bx-caption"><span>' . $caption . '</span></div>';
}
$html .= '</li>';
}
$html .= '</ul>';
$html .= '</div>';
return $html;
}
}
示例4: shortcode_blog_carousel
function shortcode_blog_carousel($atts, $content = null)
{
extract(shortcode_atts(array('title' => 'Recent News', 'type' => 'blog_cat', 'counts' => '16', 'cats' => '', 'posts' => '', 'order' => 'DESC', 'orderby' => 'date', 'auto' => 'false', 'speed' => '800', 'pause' => '5000', 'move_slides' => '2'), $atts));
$id = twoot_get_frontend_func('rand_num', 5);
if (!in_array($type, array('blog_cat', 'blog_tag'), true)) {
return $html = '<div class="the-not-posts">' . esc_attr__('Hi, please check the type option, the current type is not match!', 'Twoot_Toolkit') . '</div>';
}
switch ($type) {
case 'blog_cat':
$taxonomy = 'category';
break;
case 'blog_tag':
$taxonomy = 'post_tag';
break;
}
$q = new Twoot_Template_Carousel(array('counts' => $counts, 'cats' => $cats, 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'post_type' => 'post', 'taxonomy' => $taxonomy));
$html = '<div class="the-carousel-list the-blog-list">';
$html .= '<h5 class="carousel-title">' . $title . '</h5>';
$html .= '<ul id="post-carousel-' . $id . '" class="clearfix">';
$html .= $q->carousel();
$html .= '</ul>';
$html .= '</div>';
$html .= twoot_generator('carousel_script', $id, $auto, $speed, $pause, $move_slides, $tag = 'b');
return $html;
}
示例5: portfolio_custom_columns
/**
* Portfolio Custom Columns
* @since 1.0
* @updated 1.0
*
*/
public function portfolio_custom_columns($column)
{
global $post;
$layouts = array('half' => esc_attr__('Half Width', 'Twoot'), 'full' => esc_attr__('Full Width', 'Twoot'));
$type = ucwords(twoot_get_frontend_func('meta', 'type'));
$layout = twoot_get_frontend_func('meta', 'layout');
switch ($column) {
case 'portfolio_categories':
$terms = get_the_terms($post->ID, 'portfolio_cat');
if (!empty($terms)) {
foreach ($terms as $t) {
$output[] = '<a href="edit.php?post_type=portfolio&portfolio_cat=' . $t->slug . '">' . esc_html(sanitize_term_field('name', $t->name, $t->term_id, 'portfolio_cat', 'display')) . '</a>';
}
$output = implode(', ', $output);
} else {
$t = get_taxonomy('portfolio_cat');
$output = 'No ' . $t->label;
}
echo $output;
break;
case 'portfolio_thumbnail':
if (has_post_thumbnail()) {
the_post_thumbnail('thumbnail');
} else {
echo esc_attr__('No featured image', 'Twoot');
}
break;
case 'portfolio_type':
echo $type;
break;
case 'portfolio_layout':
echo $layouts[$layout];
break;
}
}
示例6: shortcode_twitter_carousel
function shortcode_twitter_carousel($atts, $content = null)
{
extract(shortcode_atts(array('counts' => 5, 'cache' => 1, 'auto' => 'true', 'speed' => '800', 'pause' => '5000', 'mode' => 'fade'), $atts));
$opts = get_option(TWOOT_TOOLKIT_OPTIONS);
$username = trim($opts['twitter_username']);
$key = 'cache_twitter_carousel';
$consumer_key = trim($opts['twitter_ck']);
$consumer_secret = trim($opts['twitter_cs']);
$access_token = trim($opts['twitter_at']);
$access_token_secret = trim($opts['twitter_ats']);
$do_query = new Twoot_Twitter_Handler();
$twitters = $do_query->get_recent_media($username, $key, $consumer_key, $consumer_secret, $access_token, $access_token_secret, $cache, $counts);
$html = '<div class="shortcode-twitter-carousel">';
if ($twitters) {
$i = 0;
$html .= '<div class="icon"><i class="twoot-icon-twitter-bird"></i></div>';
$html .= '<ul class="twitter-carousel" data-auto="' . $auto . '" data-speed="' . $speed . '" data-pause="' . $pause . '" data-mode="' . $mode . '">';
foreach ($twitters as $twitter) {
if ($i == $counts) {
break;
}
$html .= '<li>';
$html .= twoot_get_frontend_func('twitter_convert_links', $twitter->text);
$html .= '<span class="date meta"><a class="twitter_time" target="_blank" href="http://twitter.com/' . $username . '/statuses/' . $twitter->id_str . '">' . twoot_get_frontend_func('twitter_relative_time', $twitter->created_at) . '</a></span>';
$html .= '</li>';
$i++;
}
$html .= '</ul>';
$html .= '<div class="follow-us"><strong>' . __('Follow Us', 'Twoot_Toolkit') . '</strong> - <a href="http://twitter.com/' . $username . '" rel="external">@' . $username . '</a></div>';
} else {
$html .= '<div class="not-items">' . __('Oops, our Twitter feed is unavailable at the moment.', 'Twoot_Toolkit') . '</div>';
}
$html .= '</div>';
return $html;
}
示例7: shortcode_featured_product_carousel
function shortcode_featured_product_carousel($atts, $content = null)
{
extract(shortcode_atts(array('title' => 'Featrued Products', 'counts' => '16', 'order' => 'DESC', 'orderby' => 'date', 'auto' => 'false', 'speed' => '800', 'pause' => '5000', 'move_slides' => '4'), $atts));
global $woocommerce;
$id = twoot_get_frontend_func('rand_num', 5);
$query_args = array('posts_per_page' => $counts, 'order' => $order, 'orderby' => $orderby, 'post_status' => 'publish', 'post_type' => 'product', 'no_found_rows' => 1);
$query_args['meta_query'] = $woocommerce->query->get_meta_query();
$query_args['meta_query'][] = array('key' => '_featured', 'value' => 'yes');
$products = new WP_Query($query_args);
if ($products->have_posts()) {
$html = '<div class="the-carousel-list the-product-list">';
$html .= '<h5 class="carousel-title">' . $title . '</h5>';
$html .= '<ul id="post-carousel-' . $id . '" class="products clearfix">';
while ($products->have_posts()) {
$products->the_post();
$html .= twoot_generator('load_template', 'loop-product-carousel');
}
wp_reset_query();
$html .= '</ul>';
$html .= '</div>';
$html .= twoot_generator('carousel_script', $id, $auto, $speed, $pause, $move_slides, $tag = 'd');
} else {
$html = '<div class="the-not-posts">' . esc_attr__('Hi, please check the type option, the current type is not match!', 'Twoot_Toolkit') . '</div>';
}
return $html;
}
示例8: twoot_posts_per_page
/**
* Fixed Posts per page & pagination
*
* @since 1.0.0
*/
function twoot_posts_per_page($value)
{
if (is_tax('portfolio_cat') || is_tax('portfolio_tag')) {
$posts_per_page = twoot_get_frontend_func('opt', 'opt', 'portfolio_counts');
} else {
$posts_per_page = twoot_get_frontend_func('opt', 'opt', 'blog_counts');
}
return $posts_per_page;
}
示例9: shortcode_ads
function shortcode_ads($atts, $content = null)
{
global $ad_args;
$ad_args = array();
$count = 0;
do_shortcode($content);
$html = '<div class="shortcode-ads outer clearfix">';
foreach ($ad_args as $ad) {
$count++;
$counts = count($ad_args);
$num_class = $counts % $count == 0 ? ' odd' : ' even';
switch ($counts) {
case 1:
$grid = 'twelve';
break;
case 2:
$grid = 'six';
break;
case 3:
$grid = 'four';
break;
case 4:
$grid = 'three';
break;
}
$html .= '<div class="ad-item column ' . $grid . $num_class . '">';
$html .= '<div class="inner">';
$html .= '<div class="img img-preload img-hover">';
if ($ad['img_url']) {
$html .= twoot_get_frontend_func('resize_thumbnail_by_url', $ad['img_url'], $ad['title'], $ad['img_width'], $ad['img_height'], true);
$html .= '<div class="overlay"></div>';
}
if ($ad['title']) {
if ($ad['link']) {
$html .= '<h3 class="title"><span><a href="' . $ad['link'] . '">' . $ad['title'] . '</a></span></h3>';
} else {
$html .= '<h3 class="title"><span>' . $ad['title'] . '</span></h3>';
}
}
$html .= '</div>';
if ($ad['content']) {
$html .= '<div class="desc">' . $ad['content'] . '</div>';
}
$html .= '</div>';
$html .= '</div>';
}
$html .= '</div>';
return $html;
}
示例10: shortcode_post_masonry
function shortcode_post_masonry($atts, $content = null)
{
extract(shortcode_atts(array('ids' => '', 'width' => '460', 'height' => '9999', 'crop' => 'no', 'lightbox' => 'yes', 'columns' => 3), $atts));
$ids = explode(',', $ids);
$crop = $crop == 'yes' ? true : false;
if (is_array($ids) && !empty($ids)) {
$count = 0;
// Set the columns
switch ($columns) {
case 2:
$grid = 'six';
break;
case 3:
$grid = 'four';
break;
case 4:
$grid = 'three';
break;
}
$html = '<div class="shortcode-post-masonry post-masonry-wrapper outer">';
$html .= '<ul class="filter-items clearfix">';
foreach ($ids as $id) {
$count++;
$desc = trim(strip_tags(get_post($id)->post_content));
$caption = trim(strip_tags(get_post($id)->post_excerpt));
$tilte = $caption != false ? ' title="' . $caption . '"' : '';
$alt = trim(strip_tags(get_post_meta($id, '_wp_attachment_image_alt', true)));
$class = 'class="fancybox-gallery"';
$rel = count($ids) > 1 ? ' rel="gallery-' . get_the_ID() . '"' : '';
$html .= '<li class="img-preload img-hover item column ' . $grid . '">';
$html .= '<div class="inner">';
if ($lightbox == true) {
$html .= '<a href="' . twoot_get_frontend_func('thumbnail_url', $id) . '" ' . $class . $rel . $tilte . '>' . twoot_get_frontend_func('resize_thumbnail', $id, $caption, $width, $height, $crop) . '<div class="overlay"></div></a>';
} else {
$html .= twoot_get_frontend_func('resize_thumbnail', $id, $caption, $width, $height, $crop) . '<div class="overlay"></div>';
}
if ($caption) {
$html .= '<div class="caption"><span>' . $caption . '</span></div>';
}
$html .= '</div>';
$html .= '</li>';
}
$html .= '</ul>';
$html .= '</div>';
return $html;
}
}
示例11: shortcode_portfolio_carousel
function shortcode_portfolio_carousel($atts, $content = null)
{
extract(shortcode_atts(array('title' => 'Recent Works', 'tax' => 'cat', 'counts' => '16', 'cats' => '', 'posts' => '', 'order' => 'DESC', 'orderby' => 'date', 'auto' => 'false', 'speed' => '800', 'pause' => '5000', 'move_slides' => '4'), $atts));
$id = twoot_get_frontend_func('rand_num', 5);
if (!in_array($tax, array('cat', 'tag'), true)) {
return $html = '<div class="the-not-posts">' . esc_attr__('Hi, please check the taxonomy option, the current tax is not match!', 'Twoot_Toolkit') . '</div>';
}
$q = new Twoot_Template_Carousel(array('counts' => $counts, 'cats' => $cats, 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'post_type' => 'portfolio', 'taxonomy' => 'portfolio_' . $tax));
$html = '<div class="the-carousel-list the-portfolio-carousel">';
$html .= '<h5 class="carousel-title section-title">' . $title . '</h5>';
$html .= '<ul id="post-carousel-' . $id . '" class="clearfix">';
$html .= $q->carousel();
$html .= '</ul>';
$html .= '</div>';
$html .= twoot_generator('carousel_script', $id, $auto, $speed, $pause, $move_slides, $tag = 'p');
return $html;
}
示例12: shortcode_block_css
function shortcode_block_css($id)
{
$pt = twoot_get_frontend_func('meta', 'padding_top', $id);
$pb = twoot_get_frontend_func('meta', 'padding_bottom', $id);
$bg_color = twoot_get_frontend_func('meta', 'background_color', $id);
$bg_image = twoot_get_frontend_func('meta', 'background_image', $id);
$bg_repeat = twoot_get_frontend_func('meta', 'background_repeat', $id);
$bg_horizontal = twoot_get_frontend_func('meta', 'background_horizontal', $id);
$bg_vertical = twoot_get_frontend_func('meta', 'background_vertical', $id);
$bg_attachment = twoot_get_frontend_func('meta', 'background_attachment', $id);
$output = $pt ? 'padding-top:' . $pt . 'px;' : '';
$output .= $pb ? 'padding-bottom:' . $pb . 'px;' : '';
$output .= $bg_color ? 'background-color:' . $bg_color . ';' : '';
if ($bg_image) {
$output .= $bg_image ? 'background-image:url(' . $bg_image . ');' : '';
$output .= $bg_repeat ? 'background-repeat:' . $bg_repeat . ';' : '';
$output .= $bg_horizontal && $bg_vertical ? 'background-position:' . $bg_horizontal . ' ' . $bg_vertical . ';' : '';
$output .= $bg_attachment ? 'background-attachment:' . $bg_attachment . ';' : '';
}
return $output;
}
示例13: shortcode_testimonial_carousel
function shortcode_testimonial_carousel($atts, $content = null)
{
extract(shortcode_atts(array('auto' => 'true', 'speed' => '800', 'pause' => '5000', 'mode' => 'fade'), $atts));
global $testimonials;
$testimonials = array();
$pager_count = -1;
do_shortcode($content);
$html = '<div class="shortcode-testimonial-carousel">';
$html .= '<ul class="testimonial-carousel" data-auto="' . $auto . '" data-speed="' . $speed . '" data-pause="' . $pause . '" data-mode="' . $mode . '">';
foreach ($testimonials as $testimonial) {
$html .= '<li>';
if ($testimonial['content']) {
$html .= '<div class="content clearfix">' . do_shortcode($testimonial['content']) . '</div>';
}
if ($testimonial['name'] && $testimonial['role']) {
$html .= '<div class="item-header">';
if ($testimonial['name']) {
$html .= '<h3 class="name">' . $testimonial['name'] . '</h3>';
}
if ($testimonial['role']) {
$html .= '<div class="role">' . $testimonial['role'] . '</div>';
}
$html .= '</div>';
}
$html .= '</li>';
}
$html .= '</ul>';
$html .= '<ul id="bx-gallery-pager">';
foreach ($testimonials as $testimonial) {
$pager_count++;
if ($testimonial['avatar']) {
$html .= '<li><a data-slide-index="' . $pager_count . '" href="">' . twoot_get_frontend_func('resize_thumbnail_by_url', $testimonial['avatar'], '', 150, 150, true) . '</a></li>';
}
}
$html .= '</ul>';
$html .= '</div>';
return $html;
}
示例14: shortcode_testimonial
function shortcode_testimonial($atts, $content = null)
{
extract(shortcode_atts(array('avatar' => '', 'name' => '', 'role' => ''), $atts));
$html = '<div class="shortcode-testimonial clearfix">';
if ($avatar) {
$html .= '<div class="avatar">' . twoot_get_frontend_func('resize_thumbnail_by_url', $avatar, '', 150, 150, true) . '</div>';
}
$html .= '<div class="content">';
$html .= '<div class="text">' . do_shortcode($content) . '</div>';
if ($name && $role) {
$html .= '<div class="item-header">';
if ($name) {
$html .= '<h3 class="name">' . $name . '</h3>';
}
if ($role) {
$html .= '<div class="role">' . $role . '</div>';
}
$html .= '</div>';
}
$html .= '</div>';
$html .= '</div>';
return $html;
}
示例15: widget
function widget($args, $instance)
{
extract($args, EXTR_SKIP);
$title = apply_filters('widget_title', $instance['title']);
$icons = twoot_generator('icons');
$current_icons = twoot_get_frontend_func('opt', 'opt', 'widget_social_icons');
$all_icons = array('behance', 'dribbble', 'facebook', 'flickr', 'fivehundredpx', 'gplus', 'linkedin', 'instagram', 'pinterest', 'rss', 'soundcloud', 'tumblr', 'twitter', 'vimeo', 'youtube');
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
echo '<div class="social-icons-wrap clearfix">';
if (is_array($current_icons) && !empty($current_icons)) {
foreach ($current_icons as $current_icon) {
if (in_array($current_icon, $all_icons, true)) {
if ($icons[$current_icon]) {
echo '<a href="' . $icons[$current_icon] . '" class="' . $current_icon . '" rel="external"><i class="icon icon-' . $current_icon . '"></i></a>';
}
}
}
}
echo '</div>';
echo $after_widget;
}