本文整理汇总了PHP中themify_get_featured_image_link函数的典型用法代码示例。如果您正苦于以下问题:PHP themify_get_featured_image_link函数的具体用法?PHP themify_get_featured_image_link怎么用?PHP themify_get_featured_image_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了themify_get_featured_image_link函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: the_title
<?php
if ($hide_post_title_slider == '' || $hide_post_title_slider == 'no') {
?>
<?php
if ($unlink_post_title_slider == 'yes') {
?>
<h3 class="slide-title"><?php
the_title();
?>
</h3>
<?php
} else {
?>
<h3 class="slide-title"><a href="<?php
echo themify_get_featured_image_link();
?>
" title="<?php
the_title_attribute();
?>
" <?php
if ('yes' == $open_link_new_tab_slider) {
echo 'target="_blank"';
}
?>
><?php
the_title();
?>
</a></h3>
<?php
}
示例2: show_image
function show_image($post_image)
{
global $themify;
?>
<?php
if ('yes' == $themify->unlink_image) {
?>
<?php
echo $post_image;
?>
<?php
} else {
?>
<a href="<?php
echo themify_get_featured_image_link();
?>
">
<?php
if (themify_check('lightbox_icon')) {
?>
<span class="zoom"></span>
<?php
}
?>
<?php
echo $post_image;
?>
</a>
<?php
}
}
示例3: the_ID
/** Themify Default Variables
* @var object */
global $themify;
?>
<article itemscope itemtype="http://schema.org/Article" id="highlight-<?php
the_ID();
?>
" <?php
post_class('post clearfix highlight-post');
?>
>
<?php
$link = themify_get_featured_image_link('no_permalink=true');
$before = '';
$after = '';
if ($link != '') {
$before = '<a href="' . $link . '" title="' . get_the_title() . '">';
$zoom_icon = themify_zoom_icon(false);
$after = $zoom_icon . '</a>' . $after;
$zoom_icon = '';
}
// Chart color
// Save post id
$post_id = get_the_ID();
$bar_percentage = get_post_meta($post_id, 'bar_percentage', true);
if ($bar_percentage) {
// Key in theme settings
$bar_color_key = 'styling-backgrounds-chart_bar_color-background_color-value-value';
示例4: themify_shortcode_post_slider
/**
* Create a slider with posts retrieved through get_posts
* @param Object $atts
* @param String $content
* @return String
*/
function themify_shortcode_post_slider($atts, $content = null)
{
extract(shortcode_atts(array('visible' => '1', 'scroll' => '1', 'auto' => '0', 'pause_hover' => 'no', 'wrap' => 'yes', 'excerpt_length' => '20', 'speed' => 'normal', 'slider_nav' => 'yes', 'pager' => 'yes', 'limit' => '5', 'offset' => '0', 'category' => '', 'image' => 'yes', 'image_w' => '240px', 'image_h' => '180px', 'more_text' => __('More...', 'themify'), 'title' => 'yes', 'display' => 'none', 'post_meta' => 'no', 'post_date' => 'no', 'width' => '100%', 'height' => 'auto', 'class' => '', 'unlink_title' => 'no', 'unlink_image' => 'no', 'image_size' => 'medium', 'post_type' => 'post', 'taxonomy' => 'category', 'order' => 'DESC', 'orderby' => 'date', 'effect' => 'scroll'), $atts, 'themify_post_slider'));
$postsliderstr = '';
global $post;
$query_args = array('numberposts' => $limit, 'offset' => $offset, 'post_type' => $post_type, 'order' => $order, 'orderby' => $orderby, 'suppress_filters' => false, 'post__not_in' => !is_home() ? array(get_the_ID()) : array());
if ('' != $category) {
$tax_query_terms = explode(',', $category);
if (preg_match('#[a-z]#', $category)) {
$query_args['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'slug', 'terms' => $tax_query_terms));
} else {
$exclude = array_filter($tax_query_terms, 'themify_is_negative_number');
$query_args['tax_query'] = array('relation' => 'AND', array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => array_filter($tax_query_terms, 'themify_is_positive_number')), array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => array_map('themify_make_absolute_number', $exclude), 'operator' => 'NOT IN'));
}
}
$posts = get_posts(apply_filters('themify_post_slider_shortcode_query_args', $query_args, $atts));
if ($posts) {
switch ($speed) {
case 'fast':
$speed = '.5';
break;
case 'normal':
$speed = '1';
break;
case 'slow':
$speed = '4';
break;
}
$class .= ' effect-' . $effect;
$js_data['slider_nav'] = $slider_nav == 'yes' ? 1 : 0;
$js_data['pager'] = $pager == 'yes' ? 1 : 0;
$js_data['wrapvar'] = $wrap == 'yes' ? 1 : 0;
$js_data['play'] = intval($auto);
$js_data['pause_hover'] = $pause_hover == 'yes' ? 1 : 0;
$js_data['speed'] = $speed;
$js_data['scroll'] = $scroll;
$js_data['effect'] = $effect;
$js_data['visible'] = intval($visible);
$js_data['numsldr'] = rand(0, 1011) . uniqid();
$postsliderstr = '<!-- shortcode post_slider --> <div id="slider-' . esc_attr($js_data['numsldr']) . '" style="width: ' . esc_attr($width) . '; height: ' . esc_attr($height) . ';" class="shortcode clearfix post-slider ' . $class . '">
<ul class="slides" data-slider="' . esc_attr(json_encode($js_data)) . '">';
unset($js_data);
foreach ($posts as $post) {
setup_postdata($post);
global $more;
$more = 0;
$post_class = '';
foreach (get_post_class() as $postclass) {
$post_class .= " " . $postclass;
}
//get_post_class() as $postclass
$postsliderstr .= '<li><div class="slide-wrap ' . esc_attr($post_class) . '">';
if ('yes' == $image) {
$video_url = themify_get('video_url');
if ('' != $video_url) {
$postsliderstr .= '<div class="post-video">';
global $wp_embed;
$postsliderstr .= $wp_embed->run_shortcode('[embed]' . $video_url . '[/embed]');
$postsliderstr .= '</div>';
} else {
if ('no' == $unlink_image) {
$postsliderstr .= themify_get_image(array('image_size=' => $image_size, 'ignore' => true, 'w' => $image_w, 'h' => $image_h, 'alt' => get_the_title(), 'before' => '<p class="post-image"><a href="' . themify_get_featured_image_link() . '">', 'after' => '</a></p>'));
} else {
$postsliderstr .= themify_get_image(array('image_size' => $image_size, 'ignore' => true, 'w' => $image_w, 'h' => $image_h, 'alt' => get_the_title(), 'before' => '<p class="post-image">', 'after' => '</p>'));
}
}
}
//'yes' == $image
if ('yes' == $title) {
if ('no' == $unlink_title) {
$postsliderstr .= '<h3 class="post-title"><a href="' . themify_get_featured_image_link() . '">' . get_the_title() . '</a></h3>';
} else {
$postsliderstr .= '<h3 class="post-title">' . get_the_title() . '</h3>';
}
}
//$title == "yes"
if ($post_date == "yes") {
$postsliderstr .= '<p class="post-date">' . get_the_date() . '</p>';
}
//$post_date == "yes"
if ('yes' == $post_meta) {
$postsliderstr .= '<p class="post-meta">
<span class="post-author">' . get_the_author() . '</span>
<span class="post-category">' . get_the_category_list(', ') . '</span>';
if (comments_open()) {
ob_start();
comments_popup_link('0', '1', '%', 'comments-link', '');
$write_comments = ob_get_contents();
ob_clean();
} else {
$write_comments = '';
}
$postsliderstr .= '<span class="post-comment">' . $write_comments . '</span>';
if (has_tag()) {
//.........这里部分代码省略.........
示例5: themify_shortcode_post_slider
/**
* Create a slider with posts retrieved through get_posts
* @param Object $atts
* @param String $content
* @return String
*/
function themify_shortcode_post_slider($atts, $content = null)
{
wp_enqueue_script('themify-carousel-js');
extract(shortcode_atts(array('visible' => '1', 'scroll' => '1', 'auto' => '0', 'pause_hover' => 'no', 'wrap' => 'yes', 'excerpt_length' => '20', 'speed' => 'normal', 'slider_nav' => 'yes', 'pager' => 'yes', 'limit' => '5', 'offset' => '0', 'category' => '', 'image' => 'yes', 'image_w' => '240px', 'image_h' => '180px', 'more_text' => __('More...', 'themify'), 'title' => 'yes', 'display' => 'none', 'post_meta' => 'no', 'post_date' => 'no', 'width' => '', 'height' => '', 'class' => '', 'unlink_title' => 'no', 'unlink_image' => 'no', 'image_size' => 'medium', 'post_type' => 'post', 'taxonomy' => 'category', 'order' => 'DESC', 'orderby' => 'date', 'effect' => 'scroll'), $atts, 'themify_post_slider'));
$wrapvar = 'false';
if ('yes' == $wrap) {
$wrapvar = 'true';
}
if ('0' == $auto) {
$play = 'false';
} else {
$play = 'true';
}
switch ($speed) {
case 'fast':
$speed = '.5';
break;
case 'normal':
$speed = '1';
break;
case 'slow':
$speed = '4';
break;
}
$pause_hover = $pause_hover == 'yes' ? 'true' : 'false';
$numsldr = rand(0, 10000);
$postsliderstr = '';
global $post;
$query_args = array('numberposts' => $limit, 'offset' => $offset, 'post_type' => $post_type, 'order' => $order, 'orderby' => $orderby, 'suppress_filters' => false, 'post__not_in' => array(get_the_ID()));
if ('' != $category) {
$tax_query_terms = explode(',', $category);
if (preg_match('#[a-z]#', $category)) {
$query_args['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'slug', 'terms' => $tax_query_terms));
} else {
$exclude = array_filter($tax_query_terms, 'themify_is_negative_number');
$query_args['tax_query'] = array('relation' => 'AND', array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => array_filter($tax_query_terms, 'themify_is_positive_number')), array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => array_map('themify_make_absolute_number', $exclude), 'operator' => 'NOT IN'));
}
}
$posts = get_posts($query_args);
$class .= ' effect-' . $effect;
if ($posts) {
$postsliderstr = '<!-- shortcode post_slider --> <div id="post-slider-' . esc_attr($numsldr) . '" style="width: ' . esc_attr($width) . '; height: ' . esc_attr($height) . ';" class="shortcode clearfix post-slider ' . $class . '">
<ul class="slides">';
foreach ($posts as $post) {
setup_postdata($post);
global $more;
$more = 0;
$post_class = '';
foreach (get_post_class() as $postclass) {
$post_class .= " " . $postclass;
}
//get_post_class() as $postclass
$postsliderstr .= '<li><div class="slide-wrap ' . esc_attr($post_class) . '">';
if ('yes' == $image) {
$video_url = themify_get('video_url');
if ('' != $video_url) {
$postsliderstr .= '<div class="post-video">';
global $wp_embed;
$postsliderstr .= $wp_embed->run_shortcode('[embed]' . $video_url . '[/embed]');
$postsliderstr .= '</div>';
} else {
if ('no' == $unlink_image) {
$postsliderstr .= themify_get_image(array('image_size=' => $image_size, 'ignore' => true, 'w' => $image_w, 'h' => $image_h, 'alt' => get_the_title(), 'before' => '<p class="post-image"><a href="' . themify_get_featured_image_link() . '">', 'after' => '</a></p>'));
} else {
$postsliderstr .= themify_get_image(array('image_size' => $image_size, 'ignore' => true, 'w' => $image_w, 'h' => $image_h, 'alt' => get_the_title(), 'before' => '<p class="post-image">', 'after' => '</p>'));
}
}
}
//'yes' == $image
if ('yes' == $title) {
if ('no' == $unlink_title) {
$postsliderstr .= '<h3 class="post-title"><a href="' . themify_get_featured_image_link() . '">' . get_the_title() . '</a></h3>';
} else {
$postsliderstr .= '<h3 class="post-title">' . get_the_title() . '</h3>';
}
}
//$title == "yes"
if ($post_date == "yes") {
$postsliderstr .= '<p class="post-date">' . get_the_date() . '</p>';
}
//$post_date == "yes"
if ('yes' == $post_meta) {
$postsliderstr .= '<p class="post-meta">
<span class="post-author">' . get_the_author() . '</span>
<span class="post-category">' . get_the_category_list(', ') . '</span>';
if (comments_open()) {
ob_start();
comments_popup_link('0', '1', '%', 'comments-link', '');
$write_comments = ob_get_contents();
ob_clean();
} else {
$write_comments = '';
}
$postsliderstr .= '<span class="post-comment">' . $write_comments . '</span>';
//.........这里部分代码省略.........