• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_the_post_thumbnail_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_the_post_thumbnail_url函数的典型用法代码示例。如果您正苦于以下问题:PHP get_the_post_thumbnail_url函数的具体用法?PHP get_the_post_thumbnail_url怎么用?PHP get_the_post_thumbnail_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_the_post_thumbnail_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: opengraph

    public function opengraph()
    {
        $tags = [];
        if (is_singular()) {
            $tags['og:title'] = get_the_title();
        } elseif (is_archive()) {
            $tags['og:title'] = get_the_archive_title();
        }
        if (is_singular()) {
            $tags['og:description'] = get_the_excerpt();
        }
        if (is_singular()) {
            $tags['og:url'] = get_permalink();
        } elseif (is_tax()) {
            $tags['og:url'] = get_term_link(get_queried_object(), get_queried_object()->taxonomy);
        }
        if (is_singular() && has_post_thumbnail()) {
            $tags['og:image'] = get_the_post_thumbnail_url('full');
        }
        $tags = wp_parse_args($tags, ['og:type' => 'website', 'og:title' => get_bloginfo('name'), 'og:description' => get_bloginfo('description'), 'og:url' => home_url('/'), 'og:image' => get_site_icon_url()]);
        $tags = array_filter($tags);
        $tags = apply_filters('opengraph_tags', $tags);
        foreach ($tags as $property => $content) {
            printf('
			<meta property="%s" content="%s">', esc_attr($property), esc_attr($content));
        }
    }
开发者ID:tomjal,项目名称:feelingrestful-theme,代码行数:27,代码来源:class-opengraph.php


示例2: wpb_latest_sticky

function wpb_latest_sticky()
{
    /* Get all sticky posts */
    $sticky = get_option('sticky_posts');
    /* Sort the stickies with the newest ones at the top */
    rsort($sticky);
    /* Get the 5 newest stickies (change 5 for a different number) */
    $sticky = array_slice($sticky, 0, 1);
    /* Query sticky posts */
    $the_query = new WP_Query(array('post__in' => $sticky, 'ignore_sticky_posts' => 1));
    // The Loop
    $arr = array();
    if ($the_query->have_posts()) {
        while ($the_query->have_posts()) {
            $the_query->the_post();
            $arr['permlink'] = get_permalink("", "", false);
            $arr['title'] = get_the_title("", "", false);
            $arr['excerpt'] = get_the_excerpt("", "", false);
            $arr['img_url'] = get_the_post_thumbnail_url();
        }
    } else {
        // no posts found
        $arr['excerpt'] = $arr['title'] = $arr['permlink'] = $arr["img_url"] = "404 not found any featured post ! :( ";
    }
    /* Restore original Post Data */
    wp_reset_postdata();
    return $arr;
}
开发者ID:duongcuong96,项目名称:my-wp-themes,代码行数:28,代码来源:functions.php


示例3: get_css

    /**
     * @return string Inline CSS
     * @since 0.0.1-dev
     */
    private function get_css()
    {
        if (has_post_thumbnail() && !post_password_required()) {
            $thumb = esc_url(get_the_post_thumbnail_url(null, 'push7ssb-sbz-thumbnail'));
        } elseif (has_site_icon()) {
            $thumb = esc_url(get_site_icon_url());
        } else {
            $thumb = '';
        }
        return <<<EOI
.push7-sb-sbz-with-thumb {
\tbackground-image: url({$thumb});
}
.push7-sb-sbz-with-thumb-subscribe {
\tbackground-color: rgba(43,43,43, 0.7);
\tcolor: #ffffff;
}
@media only screen and (min-width : 415px) {
\t.push7-sb-sbz-with-thumb-thumbnail {
\t\tbackground-image: url({$thumb});
\t}
\t.push7-sb-sbz-with-thumb-subscribe {
\t\tbackground-color: rgba(43,43,43, 1);
\t}
}
EOI;
    }
开发者ID:hinaloe,项目名称:push7-subscribe-button,代码行数:31,代码来源:class.withthumb.php


示例4: wcj_get_product_image_url

 /**
  * wcj_get_product_image_url.
  *
  * @version 2.5.7
  * @since   2.5.7
  * @todo    placeholder
  */
 function wcj_get_product_image_url($product_id, $image_size = 'shop_thumbnail')
 {
     if (has_post_thumbnail($product_id)) {
         $image_url = get_the_post_thumbnail_url($product_id, $image_size);
     } elseif (($parent_id = wp_get_post_parent_id($product_id)) && has_post_thumbnail($parent_id)) {
         $image_url = get_the_post_thumbnail_url($parent_id, $image_size);
     } else {
         $image_url = '';
     }
     return $image_url;
 }
开发者ID:algoritmika,项目名称:woocommerce-jetpack,代码行数:18,代码来源:wcj-functions.php


示例5: widget

 function widget($args, $instance)
 {
     /* Our variables from the widget settings. */
     $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : __(' ', 'bookyourtravel'));
     extract($args);
     echo $before_widget;
     $url = get_post_meta($title, '_location', true);
     $img = get_the_post_thumbnail_url($title, 'large');
     echo "<a target='_blank' href='" . $url . "'><img  src='" . $img . "'></a>";
     /* After widget (defined by themes). */
     echo $after_widget;
 }
开发者ID:boutitinizar,项目名称:bati-men,代码行数:12,代码来源:widget_mnb_banner.php


示例6: get_thumbnail

 /**
  * Get thumbnail image url
  *
  * @param null|\WP_Post $_post Post data object.
  *
  * @return string
  */
 public static function get_thumbnail($_post = null)
 {
     $thumb = apply_filters(VA_SOCIALBUZZ_PREFIX . 'default_thumbnail', 'none');
     if (empty($_post)) {
         global $post;
         $_post = $post;
     }
     if (!empty($_post) && has_post_thumbnail($_post) && !post_password_required($_post)) {
         $thumb = get_the_post_thumbnail_url($_post, VA_SOCIALBUZZ_PREFIX . 'thumbnail');
     } elseif ('none' === $thumb && has_header_image()) {
         $thumb = get_header_image();
     } elseif ('none' === $thumb && has_site_icon()) {
         $thumb = get_site_icon_url();
     }
     return $thumb;
 }
开发者ID:visualive,项目名称:va-social-buzz,代码行数:23,代码来源:trait-functions.php


示例7: __construct

 function __construct($wp_post)
 {
     $this->id = (int) $wp_post->ID;
     $this->type = $wp_post->post_type;
     $this->slug = $wp_post->post_name;
     $this->url = get_permalink($this->id);
     $this->status = $wp_post->post_status;
     $this->title = get_the_title($this->id);
     $this->title_plain = strip_tags(@$this->title);
     $this->excerpt = apply_filters('the_excerpt', get_the_excerpt($wp_post->ID));
     $this->date = get_the_time($wp_post->ID);
     $this->modified = $wp_post->post_modified;
     $this->categories = get_the_category($this->id);
     $tags = get_the_tags($this->id);
     $this->tags = $tags ? $tags : array();
     $this->author = get_the_author($wp_post->ID);
     $this->comment_count = (int) $wp_post->comment_count;
     $this->comment_status = $wp_post->comment_status;
     $this->thumbnail = get_the_post_thumbnail_url($wp_post->ID);
     $this->custom_fields = get_post_custom($this->id);
 }
开发者ID:neekey,项目名称:wordpress-simple-api,代码行数:21,代码来源:post.php


示例8: init

 /**
  * @internal
  * @param false|object $coauthor co-author object
  */
 protected function init($coauthor = false)
 {
     $this->id = $coauthor->ID;
     $this->first_name = $coauthor->first_name;
     $this->last_name = $coauthor->last_name;
     $this->user_nicename = $coauthor->user_nicename;
     $this->description = $coauthor->description;
     /**
      * @property string name
      */
     $this->display_name = $coauthor->display_name;
     $this->_link = get_author_posts_url(null, $coauthor->user_nicename);
     // 96 is the default wordpress avatar size
     $avatar_url = get_the_post_thumbnail_url($this->id, 96);
     if (CoAuthorsPlus::$prefer_gravatar || !$avatar_url) {
         $avatar_url = get_avatar_url($coauthor->user_email);
     }
     if ($avatar_url) {
         $this->avatar = new \Timber\Image($avatar_url);
     }
 }
开发者ID:jarednova,项目名称:timber,代码行数:25,代码来源:CoAuthorsPlusUser.php


示例9: the_ID

?>

<article id="post-<?php 
the_ID();
?>
" <?php 
post_class();
?>
>
	<div class="entry-wrapper">
		<?php 
if (!is_single() && has_post_thumbnail()) {
    ?>
			<div class="entry-image">
				<?php 
    $post_image_thumbnail_url = get_the_post_thumbnail_url(get_the_ID(), 'full');
    $post_image_thumbnail = aq_resize($post_image_thumbnail_url, 310, '', false, false);
    ?>
				<a class="post-feature-image" href="<?php 
    the_permalink();
    ?>
">
					<img class="img-responsive" src="<?php 
    echo $post_image_thumbnail[0];
    ?>
"
					     width="<?php 
    echo $post_image_thumbnail[1];
    ?>
"
					     height="<?php 
开发者ID:dungtd91,项目名称:bones,代码行数:31,代码来源:content.php


示例10: the_post_thumbnail_url

/**
 * Display the post thumbnail URL.
 *
 * @since 4.4.0
 *
 * @param string|array $size Optional. Image size to use. Accepts any valid image size,
 *                           or an array of width and height values in pixels (in that order).
 *                           Default 'post-thumbnail'.
 */
function the_post_thumbnail_url($size = 'post-thumbnail')
{
    $url = get_the_post_thumbnail_url(null, $size);
    if ($url) {
        echo esc_url($url);
    }
}
开发者ID:AndreyLanko,项目名称:perevorot-prozorro-wp,代码行数:16,代码来源:post-thumbnail-template.php


示例11: foreach

</section>

<?php 
$features = $fields['features'];
if ($features[0] != 0) {
    /* if there are features */
    ?>

<section id="home-features" class="row full-width">
	<?php 
    $f = 1;
    foreach ($features as $featureObj) {
        $feature = $featureObj['feature'];
        $id = $feature->ID;
        $featureFields = get_fields($id);
        $imageSrc = get_the_post_thumbnail_url($id, 'home-feature');
        $title = $feature->post_title;
        $subtitle = $featureFields['subtitle'];
        $excerpt = $feature->post_excerpt;
        $link = get_the_permalink($id);
        ?>
			
			<div class="feature <?php 
        if ($f % 2 == 0) {
            echo 'reverse';
        }
        ?>
 animate-in">
				
				<div class="image animate-element <?php 
        if ($f % 2 == 0) {
开发者ID:SirDingus,项目名称:andyducett,代码行数:31,代码来源:index.php


示例12: if

            </div>
            <div class="content-body">

		    	<?php if (have_posts()): while (have_posts()) : the_post(); ?>
					<div class="body-container">
						<h1><?php the_title(); ?></h1>
						<?php the_content(); // Dynamic Content ?>
						<div class="pagination">

							<?php $nextPost = get_next_post(true);?>
								<div class="previous" style="background-image:url('<?php echo get_the_post_thumbnail_url($nextPost->ID); ?>');">
									<?php next_post_link('%link', '<span>Previous Story</span><p>%title</p>'); ?>
								</div>
							

							<div class="home"><h3><a href="/news/">Back to news home</a></h3></div> 
							
							<?php $prevPost = get_previous_post(true);?>
							<div class="next" style="background-image:url('<?php echo get_the_post_thumbnail_url($prevPost->ID); ?>');"><?php previous_post_link('%link', '<span>Next Story</span><p>%title</p>'); ?>
							</div>
							
						</div>
					</div>

		    	<?php endwhile; ?>

				<?php endif; ?>

			</div>

开发者ID:jknowles94,项目名称:Work-examples,代码行数:29,代码来源:single-news.php


示例13: jkl_post_nav

    /**
     * Display navigation to next/previous post when applicable.
     *
     * Improve the post_nav() with post thumbnails. Help from this
     * @link: http://www.measureddesigns.com/adding-previous-next-post-wordpress-post/
     * @link: http://wpsites.net/web-design/add-featured-images-to-previous-next-post-nav-links/
     */
    function jkl_post_nav()
    {
        // Don't print empty markup if there's nowhere to navigate.
        $previous = is_attachment() ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true);
        $next = get_adjacent_post(false, '', false);
        $prevID = $previous ? $previous->ID : '';
        $nextID = $next ? $next->ID : '';
        if (!$next && !$previous) {
            return;
        }
        ?>
	<nav class="navigation post-navigation clear" role="navigation">
		<h2 class="screen-reader-text"><?php 
        _e('Post navigation', 'jkl');
        ?>
</h2>

                <div class="nav-links">
                    <?php 
        // My custom code below FIRST, then _s code
        // PREVIOUS POST LINK
        if (!empty($previous)) {
            ?>
                    <div class="nav-previous">
                        <a href="<?php 
            echo get_permalink($prevID);
            ?>
" rel="prev">

                            <?php 
            if (has_post_thumbnail($prevID) && has_post_thumbnail($nextID)) {
                $prev_thumb = get_the_post_thumbnail_url($prevID, 'medium');
                $prev_thumb = $prev_thumb ? $prev_thumb : get_header_image();
                ?>
                                    <div class="post-nav-thumb" style="background-image: url( <?php 
                echo $prev_thumb;
                ?>
 )">
                                        <!-- Placeholder for image -->
                                    </div>
                            <?php 
            }
            ?>

                            <span class="meta-nav" aria-hidden="true"><?php 
            _e('Previously', 'jkl');
            ?>
</span>
                            <span class="screen-reader-text"><?php 
            _e('Previous Post', 'jkl');
            ?>
</span>
                            <span class="post-title"><?php 
            echo $previous->post_title;
            ?>
</span>

                        </a>
                    </div>
                    <?php 
        }
        // NEXT POST LINK
        if (!empty($next)) {
            ?>
                    <div class="nav-next">
                        <a href="<?php 
            echo get_permalink($nextID);
            ?>
" rel="next">

                            <?php 
            if (has_post_thumbnail($prevID) && has_post_thumbnail($nextID)) {
                $next_thumb = get_the_post_thumbnail_url($nextID, 'medium');
                $next_thumb = $next_thumb ? $next_thumb : get_header_image();
                ?>
                                    <div class="post-nav-thumb"style="background-image: url( <?php 
                echo $next_thumb;
                ?>
 )">
                                        <!-- Placeholder for image -->
                                    </div>
                            <?php 
            }
            ?>

                            <span class="meta-nav" aria-hidden="true"><?php 
            _e('Next time', 'jkl');
            ?>
</span>
                            <span class="screen-reader-text"><?php 
            _e('Next Post', 'jkl');
            ?>
</span>
//.........这里部分代码省略.........
开发者ID:jekkilekki,项目名称:theme-jkl,代码行数:101,代码来源:template-tags.php


示例14: while

    //                            endwhile;
    ?>
                                            
                            </ul>-->
                                
                            <ul class="testimonial-quotes">
                            <?php 
    while ($query->have_posts()) {
        $query->the_post();
        if ('' != get_the_post_thumbnail()) {
            ?>
                                    <li class="quote quote-<?php 
            echo get_the_ID();
            ?>
" data-thumb="<?php 
            echo get_the_post_thumbnail_url($post, 'medium');
            ?>
">
                                    <?php 
            get_template_part('components/features/frontpage/front', 'testimonials');
            ?>
                                    </li>
                                <?php 
        }
    }
    ?>
                            </ul>    
                            </div>
                        </section><!-- #testimonials -->
                        
                    <?php 
开发者ID:jekkilekki,项目名称:theme-jin,代码行数:31,代码来源:frontpage-portfolio.php


示例15: while



    <?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>

            <!--BEGIN .hentry-->
            <?php 
        echo '<div class="services">';
        echo '<div class="service">
                        <h1 class="service-title">' . get_the_title() . '</h1>
                        <hr/>
                        <div class="service-content">
                            <img class="service-img" src="' . get_the_post_thumbnail_url() . '">
                            <p class="service-desc">' . get_the_content() . '</p>
                        </div>
                      </div>';
        echo '</div>';
        ?>
            <?php 
    }
}
?>

    <!--END #primary .hfeed-->
</div>

<?php 
get_footer();
开发者ID:prkirby,项目名称:AbsolutePressure,代码行数:29,代码来源:single-services_offered.php


示例16: get_product_header

function get_product_header($postID)
{
    ?>
	<div class="images">
		<?php 
    $product_gallery_images = get_field('product_gallery_image', $postID);
    $slider_width = 570;
    $slider_height = 420;
    if (has_post_thumbnail() && count($product_gallery_images)) {
        ?>
			<div id="product-slider">
				<ul class="slides">
					<?php 
        if (has_post_thumbnail()) {
            $product_image_url = get_the_post_thumbnail_url($postID, 'full');
            $product_image = aq_resize($product_image_url, $slider_width, $slider_height, true, false);
            if (!$product_image) {
                $product_image = db_aq_resize($product_image_url);
            }
            ?>
						<li style="width: <?php 
            echo $slider_width;
            ?>
px; height: <?php 
            echo $slider_height;
            ?>
px">
							<img data-src="<?php 
            echo $product_image[0];
            ?>
" width="<?php 
            echo $product_image[1];
            ?>
"
							     height="<?php 
            echo $product_image[2];
            ?>
"/>
						</li>
					<?php 
        }
        foreach ($product_gallery_images as $image) {
            $image_resize = aq_resize($image['url'], $slider_width, $slider_height, true, false, true);
            ?>
						<li style="width: <?php 
            echo $slider_width;
            ?>
px; height: <?php 
            echo $slider_height;
            ?>
px">
							<img data-src="<?php 
            echo $image_resize[0];
            ?>
" width="<?php 
            echo $image_resize[1];
            ?>
"
							     height="<?php 
            echo $image_resize[2];
            ?>
" alt="<?php 
            echo $image['alt'];
            ?>
"/>
						</li>
					<?php 
        }
        ?>
				</ul>
				<div id="product-thumbnails">
					<?php 
        $i = 0;
        ?>
					<?php 
        if (has_post_thumbnail()) {
            $product_image_url = get_the_post_thumbnail_url($postID, 'full');
            $product_image = aq_resize($product_image_url, 170, 130, true, false, true);
            ?>
						<a data-slide-index="<?php 
            echo $i;
            ?>
" href="#"><img
									data-src="<?php 
            echo $product_image[0];
            ?>
" width="<?php 
            echo $product_image[1];
            ?>
"
									height="<?php 
            echo $product_image[2];
            ?>
"/></a>
						<?php 
            $i++;
        }
        ?>
					<?php 
        foreach ($product_gallery_images as $image) {
//.........这里部分代码省略.........
开发者ID:dungtd91,项目名称:bones,代码行数:101,代码来源:template-tags.php


示例17: get_bloginfo

}
if (!isset($meta_url)) {
    $meta_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}
if (!isset($description_content)) {
    $description_content = get_bloginfo('description');
}
if (!isset($keywords)) {
    $keywords = "bem infinito, ação social, doação";
}
if (is_page()) {
    $t = get_the_title();
    if (strtolower($t) != "bem infinito") {
        $t = preg_replace("/&#?[a-z0-9]+;/i", "", $t . ' | ' . $meta_title);
    }
    $i = has_post_thumbnail() ? get_the_post_thumbnail_url() : $meta_image;
    $d = preg_replace("/&#?[a-z0-9]+;/i", "", get_field('descricao'));
    $k = preg_replace("/&#?[a-z0-9]+;/i", "", get_field('keywords'));
    if ($t != "") {
        $meta_title = $t;
    }
    if ($i != "") {
        $meta_image = $i;
    }
    if ($d != "") {
        $description_content = $d;
    }
    if ($k != "") {
        $keywords = $k;
    }
} else {
开发者ID:Didox,项目名称:beminfinito,代码行数:31,代码来源:meta.php


示例18: siteorigin_panels_ajax_get_prebuilt_layouts

function siteorigin_panels_ajax_get_prebuilt_layouts()
{
    if (empty($_REQUEST['_panelsnonce']) || !wp_verify_nonce($_REQUEST['_panelsnonce'], 'panels_action')) {
        wp_die();
    }
    // Get any layouts that the current user could edit.
    header('content-type: application/json');
    $type = !empty($_REQUEST['type']) ? $_REQUEST['type'] : 'directory';
    $search = !empty($_REQUEST['search']) ? trim(strtolower($_REQUEST['search'])) : '';
    $page = !empty($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
    $return = array('title' => '', 'items' => array());
    if ($type == 'prebuilt') {
        $return['title'] = __('Theme Defined Layouts', 'siteorigin-panels');
        // This is for theme bundled prebuilt directories
        $layouts = apply_filters('siteorigin_panels_prebuilt_layouts', array());
        foreach ($layouts as $id => $vals) {
            if (!empty($search) && strpos(strtolower($vals['name']), $search) === false) {
                continue;
            }
            $return['items'][] = array('title' => $vals['name'], 'id' => $id, 'type' => 'prebuilt', 'description' => isset($vals['description']) ? $vals['description'] : '', 'screenshot' => !empty($vals['screenshot']) ? $vals['screenshot'] : '');
        }
        $return['max_num_pages'] = 1;
    } elseif ($type == 'directory') {
        $return['title'] = __('Layouts Directory', 'siteorigin-panels');
        // This is a query of the prebuilt layout directory
        $query = array();
        if (!empty($search)) {
            $query['search'] = $search;
        }
        $query['page'] = $page;
        $url = add_query_arg($query, SITEORIGIN_PANELS_LAYOUT_URL . '/wp-admin/admin-ajax.php?action=query_layouts');
        $response = wp_remote_get($url);
        if (is_array($response) && $response['response']['code'] == 200) {
            $results = json_decode($response['body'], true);
            if (!empty($results) && !empty($results['items'])) {
                foreach ($results['items'] as $item) {
                    $item['id'] = $item['slug'];
                    $item['screenshot'] = 'http://s.wordpress.com/mshots/v1/' . urlencode($item['preview']) . '?w=400';
                    $item['type'] = 'directory';
                    $return['items'][] = $item;
                }
            }
            $return['max_num_pages'] = $results['max_num_pages'];
        }
    } elseif (strpos($type, 'clone_') !== false) {
        // Check that the user can view the given page types
        $post_type = str_replace('clone_', '', $type);
        $return['title'] = sprintf(__('Clone %s', 'siteorigin-panels'), esc_html(ucfirst($post_type)));
        global $wpdb;
        $user_can_read_private = $post_type == 'post' && current_user_can('read_private_posts') || $post_type == 'page' && current_user_can('read_private_pages');
        $include_private = $user_can_read_private ? "OR posts.post_status = 'private' " : "";
        // Select only the posts with the given post type that also have panels_data
        $results = $wpdb->get_results("\n\t\t\tSELECT SQL_CALC_FOUND_ROWS DISTINCT ID, post_title, meta.meta_value\n\t\t\tFROM {$wpdb->posts} AS posts\n\t\t\tJOIN {$wpdb->postmeta} AS meta ON posts.ID = meta.post_id\n\t\t\tWHERE\n\t\t\t\tposts.post_type = '" . esc_sql($post_type) . "'\n\t\t\t\tAND meta.meta_key = 'panels_data'\n\t\t\t\t" . (!empty($search) ? 'AND posts.post_title LIKE "%' . esc_sql($search) . '%"' : '') . "\n\t\t\t\tAND ( posts.post_status = 'publish' OR posts.post_status = 'draft' " . $include_private . ")\n\t\t\tORDER BY post_date DESC\n\t\t\tLIMIT 16 OFFSET " . intval(($page - 1) * 16));
        $total_posts = $wpdb->get_var("SELECT FOUND_ROWS();");
        foreach ($results as $result) {
            $thumbnail = get_the_post_thumbnail_url($result->ID, array(400, 300));
            $return['items'][] = array('id' => $result->ID, 'title' => $result->post_title, 'type' => $type, 'screenshot' => !empty($thumbnail) ? $thumbnail : '');
        }
        $return['max_num_pages'] = ceil($total_posts / 16);
    } else {
        // An invalid type. Display an error message.
    }
    // Add the search part to the title
    if (!empty($search)) {
        $return['title'] .= __(' - Results For:', 'siteorigin-panels') . ' <em>' . esc_html($search) . '</em>';
    }
    echo json_encode($return);
    wp_die();
}
开发者ID:spielhoelle,项目名称:amnesty,代码行数:69,代码来源:admin-actions.php


示例19: foreach

					<header class="post-related-head">
						<h3 class="post-related-title">相关内容</h3>
						<small>您可能对以下内容也有兴趣</small>
						<div class="post-icon">
							<i class="fa fa-file-text-o"></i>
						</div>
					</header>
					<div class="row">
						<?php 
foreach (get_posts(array('category__in' => array_map(function ($cat) {
    return $cat->cat_ID;
}, get_the_category()))) as $index => $post) {
    ?>
						<div class="col-md-4 col-sm-4">
							<article class="post-related-post" style="background-image: url(<?php 
    echo get_the_post_thumbnail_url($post->ID) ? get_the_post_thumbnail_url($post->ID) : get_stylesheet_directory_uri() . '/assets/images/uploads/image-02-normal-300x200.jpg';
    ?>
)">
								<h4>
									<a href="<?php 
    echo get_the_permalink($post->ID);
    ?>
"><?php 
    echo get_the_title($post->ID);
    ?>
</a>
									<!-- <small>by Manos Proistakis</small> -->
								</h4>
							</article>
						</div>
						<?php 
开发者ID:uicestone,项目名称:Hub1884,代码行数:31,代码来源:single.php


示例20: get_the_post_thumbnail_url

<?php

/**
 * teaser Heads Gallery.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package medium_magazin_beta
 */
$teaser_image = get_the_post_thumbnail_url($post, 'thumbnail');
$teaser_text = get_field('teaser-text');
?>
  <div class="item">
    <a href="<?php 
the_permalink();
?>
" class="voll-teaser-link">
      <?php 
if ($teaser_image) {
    ?>
  
      <img class="img-circle teaser3-img" src="<?php 
    echo $teaser_image;
    ?>
" alt="Card image cap">
      <?php 
}
?>
          
      <h6 class="heads-gallery-name"><?php 
the_title();
开发者ID:TStrothjohann,项目名称:mmbeta,代码行数:31,代码来源:teaser-heads-gallery.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_the_posts_pagination函数代码示例发布时间:2022-05-15
下一篇:
PHP get_the_post_thumbnail函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap