当前位置: 首页>>代码示例>>PHP>>正文


PHP wpex_get_esc_title函数代码示例

本文整理汇总了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));
}
开发者ID:iq007,项目名称:MadScape,代码行数:14,代码来源:portfolio-helpers.php

示例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) {
开发者ID:iq007,项目名称:MadScape,代码行数:31,代码来源:vcex_post_type_list.php

示例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;
            ?>
//.........这里部分代码省略.........
开发者ID:VanessaGarcia-Freelance,项目名称:TheEmporiumGroup,代码行数:101,代码来源:posts-grid.php

示例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 -->
开发者ID:PlanoBWeb,项目名称:BDA,代码行数:31,代码来源:slider.php

示例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 
}
开发者ID:iq007,项目名称:MadScape,代码行数:29,代码来源:cpt-single-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;
                    ?>
开发者ID:iq007,项目名称:MadScape,代码行数:30,代码来源:vcex_post_type_carousel.php

示例7: wpex_esc_title

/**
 * Outputs escaped post title
 *
 * @since 2.0.0
 */
function wpex_esc_title()
{
    echo wpex_get_esc_title();
}
开发者ID:PlanoBWeb,项目名称:BDA,代码行数:9,代码来源:helpers.php

示例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();
                ?>
//.........这里部分代码省略.........
开发者ID:iq007,项目名称:MadScape,代码行数:101,代码来源:posts-thumbnails.php

示例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">
开发者ID:PlanoBWeb,项目名称:BDA,代码行数:31,代码来源:entry.php

示例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 
开发者ID:iq007,项目名称:MadScape,代码行数:31,代码来源:vcex_portfolio_grid.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) {
开发者ID:iq007,项目名称:MadScape,代码行数:31,代码来源:social-share.php

示例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') . '" />';
     }
 }
开发者ID:VanessaGarcia-Freelance,项目名称:TheEmporiumGroup,代码行数:16,代码来源:woocommerce-config.php

示例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();
//.........这里部分代码省略.........
开发者ID:VanessaGarcia-Freelance,项目名称:TheEmporiumGroup,代码行数:101,代码来源:posts-thumbnails.php

示例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 -->
开发者ID:iq007,项目名称:MadScape,代码行数:30,代码来源:search-entry-thumbnail.php

示例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()));
}
开发者ID:iq007,项目名称:MadScape,代码行数:9,代码来源:testimonials-helpers.php


注:本文中的wpex_get_esc_title函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。