本文整理汇总了PHP中wpex_get_esc_title函数的典型用法代码示例。如果您正苦于以下问题:PHP wpex_get_esc_title函数的具体用法?PHP wpex_get_esc_title怎么用?PHP wpex_get_esc_title使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpex_get_esc_title函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wpex_get_portfolio_post_thumbnail
/**
* Returns correct thumbnail HTML for the portfolio posts
*
* @since 2.0.0
*/
function wpex_get_portfolio_post_thumbnail($args = array())
{
// Define thumbnail args
$defaults = array('size' => 'portfolio_post', 'class' => 'portfolio-single-media-img', 'alt' => wpex_get_esc_title(), 'schema_markup' => true);
// Parse arguments
$args = wp_parse_args($args, $defaults);
// Return thumbanil
return wpex_get_post_thumbnail(apply_filters('wpex_get_portfolio_post_thumbnail_args', $args));
}
示例2: while
// Declare counter var
$count = 0;
// Loop through posts
while ($wpex_query->have_posts()) {
// Add to counter
$count++;
// Get post from query
$wpex_query->the_post();
// Get post data
$get_post = get_post();
// Post Data
$post_id = $get_post->ID;
$post_content = $get_post->post_content;
$post_title = $get_post->post_title;
$post_type = $get_post->post_type;
$post_title_esc = wpex_get_esc_title();
$post_permalink = wpex_get_permalink($post_id);
$post_format = get_post_format($post_id);
$post_thumbnail = wp_get_attachment_url(get_post_thumbnail_id());
?>
<div class="vcex-post-type-list-entry vcex-clr vcex-count-<?php
echo $count;
?>
">
<?php
// Featured post
if ('true' == $featured_post && '1' == $count) {
// Featured post => image
if ($post_thumbnail) {
示例3: widget
/**
* Front-end display of widget.
*
* @see WP_Widget::widget()
*
* @param array $args Widget arguments.
* @param array $instance Saved values from database.
*/
function widget($args, $instance)
{
// Set vars for widget usage
$title = isset($instance['title']) ? $instance['title'] : '';
$title = apply_filters('widget_title', $title);
$post_type = isset($instance['post_type']) ? $instance['post_type'] : '';
$taxonomy = isset($instance['taxonomy']) ? $instance['taxonomy'] : '';
$terms = isset($instance['terms']) ? $instance['terms'] : '';
$number = isset($instance['number']) ? $instance['number'] : '';
$order = isset($instance['order']) ? $instance['order'] : '';
$columns = isset($instance['columns']) ? $instance['columns'] : '3';
$img_hover = isset($instance['img_hover']) ? $instance['img_hover'] : '';
$img_size = isset($instance['img_size']) ? $instance['img_size'] : 'wpex_custom';
$img_height = !empty($instance['img_height']) ? intval($instance['img_height']) : '';
$img_width = !empty($instance['img_width']) ? intval($instance['img_width']) : '';
$img_size = $img_width || $img_height ? 'wpex_custom' : $img_size;
$exclude = is_singular() ? array(get_the_ID()) : NULL;
// Sanitize terms
if ($terms) {
$terms = str_replace(', ', ',', $terms);
$terms = explode(',', $terms);
}
// Before widget WP hook
echo $args['before_widget'];
// Display title if defined
if ($title) {
echo $args['before_title'] . $title . $args['after_title'];
}
?>
<ul class="wpex-recent-posts-thumb-grid wpex-row clr">
<?php
// Query args
$query_args = array('post_type' => $post_type, 'posts_per_page' => $number, 'orderby' => $order, 'meta_key' => '_thumbnail_id', 'post__not_in' => $exclude, 'no_found_rows' => true);
// Taxonomy args
if (!empty($taxonomy) && !empty($terms)) {
$query_args['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'slug', 'terms' => $terms));
}
// Query posts
$my_query = new WP_Query($query_args);
?>
<?php
// Set post counter variable
$count = 0;
?>
<?php
// Loop through posts
while ($my_query->have_posts()) {
$my_query->the_post();
?>
<?php
// Add to counter variable
$count++;
?>
<?php
// Get post thumbnail
$thumbnail = wpex_get_post_thumbnail(array('size' => $img_size, 'width' => $img_width, 'height' => $img_height, 'alt' => wpex_get_esc_title()));
?>
<?php
// Get hover classes
if ($img_hover) {
$hover_classes = ' class="' . wpex_image_hover_classes($img_hover) . '"';
} else {
$hover_classes = '';
}
?>
<li class="<?php
echo wpex_grid_class($columns);
?>
nr-col col-<?php
echo $count;
?>
">
<a href="<?php
wpex_permalink();
?>
" title="<?php
wpex_esc_title();
?>
"<?php
echo $hover_classes;
?>
><?php
echo $thumbnail;
?>
//.........这里部分代码省略.........
示例4: the_post_thumbnail
<div class="homepage-slide-caption"><?php
echo $caption;
?>
</div>
<?php
}
?>
</div><!-- .homepage-slider-content -->
</div>
<?php
}
?>
<?php
// Display post thumbnail
the_post_thumbnail('wpex-home-slider', array('alt' => wpex_get_esc_title()));
?>
<?php
if ($url) {
echo '</a>';
}
?>
</li>
<?php
}
?>
</ul><!-- .slides -->
示例5: apply_filters
<?php
/**
* Single Custom Post Type Media
*
* @package Total WordPress theme
* @subpackage Partials
* @version 3.3.0
*/
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
}
// Thumbnail args
$args = apply_filters('wpex_' . get_post_type() . '_single_thumbnail_args', array('size' => 'full', 'alt' => wpex_get_esc_title(), 'schema_markup' => true));
// Get thumbnail
$thumbnail = wpex_get_post_thumbnail($args);
// Display featured image
if ($thumbnail) {
?>
<div id="post-media" class="wpex-clr">
<?php
echo $thumbnail;
?>
</div><!-- #post-media -->
<?php
}
示例6: wpex_get_post_thumbnail
<div class="wpex-carousel-slide wpex-clr<?php
if ($entry_css) {
echo ' ' . $entry_css;
}
?>
">
<?php
// Display media
if ('true' == $media && has_post_thumbnail()) {
?>
<?php
// Image html
$img_html = wpex_get_post_thumbnail(array('size' => $img_size, 'crop' => $img_crop, 'width' => $img_width, 'height' => $img_height, 'alt' => wpex_get_esc_title()));
?>
<div class="<?php
echo $media_classes;
?>
">
<?php
// No links
if ('none' == $thumbnail_link) {
?>
<?php
echo $img_html;
?>
示例7: wpex_esc_title
/**
* Outputs escaped post title
*
* @since 2.0.0
*/
function wpex_esc_title()
{
echo wpex_get_esc_title();
}
示例8: widget
/**
* Front-end display of widget.
*
* @see WP_Widget::widget()
*
* @param array $args Widget arguments.
* @param array $instance Saved values from database.
*/
public function widget($args, $instance)
{
// Parse instance
extract(wp_parse_args($instance, $this->defaults));
// Apply filters to the title
$title = isset($instance['title']) ? apply_filters('widget_title', $instance['title']) : '';
// Before widget WP hook
echo $args['before_widget'];
// Display title if defined
if ($title) {
echo $args['before_title'] . $title . $args['after_title'];
}
?>
<ul class="wpex-widget-recent-posts wpex-clr style-<?php
echo esc_attr($style);
?>
">
<?php
// Query args
$query_args = array('post_type' => $post_type, 'posts_per_page' => $number, 'meta_key' => '_thumbnail_id', 'no_found_rows' => true);
// Order params - needs FALLBACK don't ever edit!
if (!empty($orderby)) {
$query_args['order'] = $order;
$query_args['orderby'] = $orderby;
} else {
$query_args['orderby'] = $order;
// THIS IS THE FALLBACK
}
// Taxonomy args
if (!empty($taxonomy) && !empty($terms)) {
// Sanitize terms and convert to array
$terms = str_replace(', ', ',', $terms);
$terms = explode(',', $terms);
// Add to query arg
$query_args['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'slug', 'terms' => $terms));
}
// Exclude current post
if (is_singular()) {
$query_args['post__not_in'] = array(get_the_ID());
}
// Query posts
$wpex_query = new WP_Query($query_args);
// If there are posts loop through them
if ($wpex_query->have_posts()) {
// Loop through posts
while ($wpex_query->have_posts()) {
$wpex_query->the_post();
?>
<?php
// Get hover classes
if ($img_hover) {
$hover_classes = ' ' . wpex_image_hover_classes($img_hover);
} else {
$hover_classes = '';
}
?>
<li class="wpex-widget-recent-posts-li clr">
<?php
if (has_post_thumbnail()) {
?>
<a href="<?php
wpex_permalink();
?>
" title="<?php
wpex_esc_title();
?>
" class="wpex-widget-recent-posts-thumbnail<?php
echo esc_attr($hover_classes);
?>
">
<?php
wpex_post_thumbnail(array('size' => $img_size, 'width' => $img_width, 'height' => $img_height, 'alt' => wpex_get_esc_title()));
?>
</a>
<?php
}
?>
<a href="<?php
wpex_permalink();
?>
" title="<?php
wpex_esc_title();
?>
" class="wpex-widget-recent-posts-title"><?php
the_title();
?>
//.........这里部分代码省略.........
示例9: the_ID
<article id="post-<?php
the_ID();
?>
" <?php
post_class();
?>
>
<?php
if (has_post_thumbnail()) {
?>
<div class="staff-entry-media clr">
<?php
// Display post thumbnail
the_post_thumbnail('wpex-staff-entry', array('alt' => wpex_get_esc_title(), 'class' => 'staff-entry-img'));
?>
</div><!-- .staff-entry-media -->
<?php
}
?>
<header class="staff-entry-header">
<h2 class="staff-entry-title"><?php
the_title();
?>
</h2>
</header><!-- .staff-entry-header -->
<div class="staff-entry-content clr entry">
示例10: elseif
echo $post->title;
?>
<?php
// Link title to lightbox
} elseif ('lightbox' == $title_link) {
?>
<?php
$atts['lightbox_data'] = array();
// Lightbox data
if ($lightbox_skin && 'true' !== $thumb_lightbox_gallery) {
$atts['lightbox_data'][] = 'data-skin="' . $lightbox_skin . '"';
}
if ('true' == $thumb_lightbox_title) {
$atts['lightbox_data'][] = 'data-title="' . wpex_get_esc_title() . '"';
}
// Display lightbox
if ('true' == $thumb_lightbox_caption && $post->excerpt) {
$atts['lightbox_data'][] = 'data-caption="' . str_replace('"', "'", $post->excerpt) . '"';
}
$lightbox_data = ' ' . implode(' ', $atts['lightbox_data']);
?>
<a href="<?php
wpex_lightbox_image();
?>
" title="<?php
wpex_esc_title();
?>
" class="wpex-lightbox"<?php
示例11: wpex_social_share_sites
if (!wpex_global_obj('has_social_share') || post_password_required()) {
return;
}
// Get sharing sites
$sites = wpex_social_share_sites();
// Return if there aren't any sites enabled
if (empty($sites)) {
return;
}
// Declare main vars
$position = wpex_social_share_position();
$style = wpex_social_share_style();
$heading = wpex_social_share_heading();
$post_id = wpex_global_obj('post_id');
$url = apply_filters('wpex_social_share_url', get_permalink($post_id));
$title = html_entity_decode(wpex_get_esc_title());
// Get and encode summary
$summary = wpex_get_excerpt(array('length' => '40', 'echo' => false, 'ignore_more_tag' => true));
?>
<div class="wpex-social-share-wrap clr position-<?php
echo esc_attr($position);
if ('full-screen' == wpex_global_obj('post_layout')) {
echo ' container';
}
?>
">
<?php
// Display heading if enabled
if (wpex_get_mod('social_share_heading_enable', true) && 'horizontal' == $position) {
示例12: subcategory_thumbnail
/**
* Change category thumbnail.
*
* @since 2.0.0
*/
public static function subcategory_thumbnail($category)
{
// Get attachment id
$attachment = get_woocommerce_term_meta($category->term_id, 'thumbnail_id', true);
// Return thumbnail if attachment is defined
if ($attachment) {
wpex_post_thumbnail(array('attachment' => $attachment, 'size' => 'shop_category', 'alt' => wpex_get_esc_title()));
} else {
echo '<img src="' . wc_placeholder_img_src() . '" alt="' . __('Placeholder Image', 'wpex') . '" />';
}
}
示例13: widget
/**
* Front-end display of widget.
*
* @see WP_Widget::widget()
*
* @param array $args Widget arguments.
* @param array $instance Saved values from database.
*/
function widget($args, $instance)
{
// Set vars
$title = isset($instance['title']) ? apply_filters('widget_title', $instance['title']) : __('Recent Posts', 'wpex');
$number = isset($instance['number']) ? $instance['number'] : '3';
$style = isset($instance['style']) ? $instance['style'] : 'default';
$order = isset($instance['order']) ? $instance['order'] : '';
$date = isset($instance['date']) ? $instance['date'] : '';
$post_type = isset($instance['post_type']) ? $instance['post_type'] : '';
$taxonomy = isset($instance['taxonomy']) ? $instance['taxonomy'] : '';
$terms = isset($instance['terms']) ? $instance['terms'] : '';
$img_hover = isset($instance['img_hover']) ? $instance['img_hover'] : '';
$img_size = isset($instance['img_size']) ? $instance['img_size'] : 'wpex_custom';
$img_height = !empty($instance['img_height']) ? intval($instance['img_height']) : '';
$img_width = !empty($instance['img_width']) ? intval($instance['img_width']) : '';
$img_size = $img_width || $img_height ? 'wpex_custom' : $img_size;
$exclude = is_singular() ? array(get_the_ID()) : NULL;
// Sanitize terms
if ($terms) {
$terms = str_replace(', ', ',', $terms);
$terms = explode(',', $terms);
}
// Before widget WP hook
echo $args['before_widget'];
// Display title if defined
if ($title) {
echo $args['before_title'] . $title . $args['after_title'];
}
?>
<ul class="wpex-widget-recent-posts clr style-<?php
echo $style;
?>
">
<?php
// Query args
$query_args = array('post_type' => $post_type, 'posts_per_page' => $number, 'orderby' => $order, 'post__not_in' => $exclude, 'meta_key' => '_thumbnail_id', 'no_found_rows' => true);
// Taxonomy args
if (!empty($taxonomy) && !empty($terms)) {
$query_args['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'slug', 'terms' => $terms));
}
// Query posts
$my_query = new WP_Query($query_args);
// If there are posts loop through them
if ($my_query->have_posts()) {
// Loop through posts
while ($my_query->have_posts()) {
$my_query->the_post();
?>
<?php
// Get post thumbnail
$thumbnail = wpex_get_post_thumbnail(array('size' => $img_size, 'width' => $img_width, 'height' => $img_height, 'alt' => wpex_get_esc_title()));
?>
<?php
// Get hover classes
if ($img_hover) {
$hover_classes = ' ' . wpex_image_hover_classes($img_hover);
} else {
$hover_classes = '';
}
?>
<li class="wpex-widget-recent-posts-li clr">
<?php
if ($thumbnail) {
?>
<a href="<?php
wpex_permalink();
?>
" title="<?php
wpex_esc_title();
?>
" class="wpex-widget-recent-posts-thumbnail<?php
echo $hover_classes;
?>
"><?php
echo $thumbnail;
?>
</a>
<?php
}
?>
<a href="<?php
wpex_permalink();
?>
" title="<?php
wpex_esc_title();
//.........这里部分代码省略.........
示例14: wpex_permalink
/**
* Search entry thumbnail
*
* @package Total WordPress theme
* @subpackage Partials
* @version 3.3.0
*/
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
}
// Return if there isn't any thumbnail defined
if (!has_post_thumbnail()) {
return;
}
?>
<div class="search-entry-thumb">
<a href="<?php
wpex_permalink();
?>
" title="<?php
wpex_esc_title();
?>
" class="search-entry-img-link">
<?php
wpex_post_thumbnail(apply_filters('wpex_search_thumbnail_args', array('size' => 'thumbnail', 'width' => '', 'height' => '', 'alt' => wpex_get_esc_title())));
?>
</a>
</div><!-- .search-entry-thumb -->
示例15: wpex_get_testimonials_entry_thumbnail
/**
* Returns correct thumbnail HTML for the testimonials entries
*
* @since 2.0.0
*/
function wpex_get_testimonials_entry_thumbnail()
{
return wpex_get_post_thumbnail(array('size' => 'testimonials_entry', 'class' => 'testimonials-entry-img', 'alt' => wpex_get_esc_title()));
}