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


PHP the_post_thumbnail_url函数代码示例

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


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

示例1: widget

    public function widget($args, $instance)
    {
        global $post;
        ?>
        <div class="skc-container row">
            <div class="page-header">
                
            </div>
            <?php 
        if (have_posts()) {
            $c = 0;
            while ($c < $instance['nb_post']) {
                the_post();
                ?>
                    <div class="col-sm-6 col-md-4">
                        <main class="thumbnail">
                            <img src="<?php 
                the_post_thumbnail_url();
                ?>
" alt="<?php 
                the_title();
                ?>
 - featured image">
                            <div class="caption">
                                <div class="page-header">
                                    <h3><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h3>
                                </div>
                                <p><?php 
                the_content();
                ?>
</p>
                            </div>
                        </main>
                    </div>
                    <?php 
                $c++;
            }
            wp_reset_postdata();
        } else {
            echo 'It seems that no posts have been created now!';
        }
        ?>
        </div>
    <?php 
    }
开发者ID:Krakt,项目名称:skcomputing,代码行数:51,代码来源:widgets.php

示例2: url

<div class="mdl-cell mdl-cell--12-col">
    <div class="mdl-card mdl-cell mdl-cell--12-col">
        <div class="mdl-card__media mdl-color-text--grey-50" style="background-image: url(<?php 
the_post_thumbnail_url('thumbnail');
?>
);">
            <h3><a href="<?php 
echo get_permalink();
?>
"><?php 
the_title();
?>
</a></h3>
        </div>
        <div class="mdl-color-text--grey-600 mdl-card__supporting-text">
            <?php 
the_content('Lire la suite...');
?>
        </div>
        <div class="mdl-card__supporting-text meta mdl-color-text--grey-600">
            <div class="minilogo" style="background-image: url(<?php 
echo get_avatar_url($post->post_author);
?>
);"></div>
            <div>
                <strong><?php 
echo get_the_author_meta('display_name');
?>
</strong>
                <span><?php 
the_time(get_option('date_format'));
开发者ID:Heyfara,项目名称:wordpress-mdl,代码行数:31,代码来源:content.php

示例3: sb_meet_location

    $meet_location = sb_meet_location(get_field("meet_location"));
    $meet_theme = !empty($meet_location["locality"]) ? strtolower($meet_location["locality"]) : "severn";
    ?>
	<li class="search-results__item" data-theme="<?php 
    echo $meet_theme;
    ?>
">
		<a class="search-results__link" href="<?php 
    the_permalink();
    ?>
">
			<?php 
    if (has_post_thumbnail()) {
        ?>
				<img class="search-results__image" alt="" src="<?php 
        echo the_post_thumbnail_url('search-result');
        ?>
">
			<?php 
    }
    ?>
			<div class="search-results__body">
				<div class="search-results__type">
					Meet
				</div>
				<h2 class="search-results__title">
					<?php 
    echo sb_search_highlight(get_search_query(), get_the_title());
    ?>
				</h2>
				<div class="content search-results__content">
开发者ID:severnbronies,项目名称:severnbronies-2016,代码行数:31,代码来源:results-list.php

示例4: url

<?php

/**
 * The headerContent file, containing the head of the pages
 * @package grahlie
 */
if (get_the_post_thumbnail($post->ID)) {
    ?>
    
    <div class="header-image" style="background-image: url('<?php 
    the_post_thumbnail_url('featured-image');
    ?>
');">
        <div class="site-branding">
            <?php 
    echo grahlie_use_logotype();
    ?>
        </div>

        <nav id="site-navigation" class="main-navigation" role="navigation">
            <input type="checkbox" id="nav-trigger">
            <label for="nav-trigger" id="navopen"></label>

            <?php 
    wp_nav_menu(array('theme_location' => 'primary', 'menu_id' => 'primary-menu', 'menu_class' => 'navigation', 'container' => ''));
    ?>
        </nav>
    </div>

<?php 
} else {
开发者ID:grahlie,项目名称:grunt-wordpress-starter,代码行数:31,代码来源:headerContent.php

示例5: get_field

<div class="bxsliderWrapper" style="visibility: hidden;">

    <ul class="latest-news">

    <?php 
$post_objects = get_field('featured_news');
if ($post_objects) {
    ?>
        <?php 
    foreach ($post_objects as $post) {
        ?>
            <?php 
        setup_postdata($post);
        ?>
            <li class="news-item" style="background-image:url('<?php 
        the_post_thumbnail_url("full");
        ?>
')">

                <?php 
        the_post_thumbnail('large', ['class' => 'visible-xs img-responsive']);
        ?>

                <div class="latest-news-info">
                	<div class="clearfix">
                		<div class="latest-news-header pull-left">Latest News</div>
                		<div class="latest-news-nav pull-right">
                			<div class="news-next"></div>
                			<div class="news-prev"></div>
                		</div>
                	</div>
开发者ID:aaronfrey,项目名称:PepperLillie-CVM,代码行数:31,代码来源:front-page.php

示例6: query_posts

						<div class="col-md-9">

						<?php 
global $wp_query;
query_posts(array_merge($wp_query->query, array('orderby' => 'title', 'order' => 'ASC')));
if (have_posts()) {
    ?>
							<div class="row">
						<?php 
    while (have_posts()) {
        the_post();
        ?>
								<div class="col-sm-6">
									<figure class="product-block effect-sarah">
										<div class="product-img" style="background-image:url('<?php 
        the_post_thumbnail_url(full);
        ?>
')"></div>
										<figcaption>
											<h2><?php 
        the_title();
        ?>
</h2>
											<p>
												<span class="view-more">Find out more &rarr;</span>
											</p>
											<a href="<?php 
        the_permalink();
        ?>
">View more</a>
										</figcaption>
开发者ID:johngilesyoder,项目名称:Glo,代码行数:31,代码来源:taxonomy-product-line.php

示例7: the_post_thumbnail_url

            <!--  Encabezado -->
            <div class="modal-header">
                <h3 class="text-left">Características del producto</h3>
            </div>
            <!--  Cuerpo -->
            <div class="modal-body">
                  <!--  row1 -->              
                  <div class="row">


                            <!-- Izquierda -->
                            <div class="col-md-6 col-sm-6 col-xs-6 azul-izq">
                                   <!-- Imagen con su titulo --> 
                                   <div class="row">
                                      <div class="col-md-12 thumb">
                                            <img src="<?php  the_post_thumbnail_url() ?>" class="img-responsive img-diseno">
                                            <?php 
                                              //get_post_thumbnail( get_the_ID() );
                                              echo '<p class="nombre">';
                                                   the_title();                                              
                                              echo '</p>';

                                            ?>
                                      </div>
                                  </div>
                                  <div class="row">
                                   	<div class="col-md-12">
                                   		<p>Incluye:</p>
                                   		<p>Tu nombre en cada página interior o el de quien quieras.</p>
								  	</div>
								  	<div class="col-md-12 colores">
开发者ID:estrategasdigitales,项目名称:digmota,代码行数:31,代码来源:modal.php

示例8: test_the_post_thumbnail_url

 /**
  * @ticket 33070
  */
 function test_the_post_thumbnail_url()
 {
     $GLOBALS['post'] = self::$post;
     ob_start();
     the_post_thumbnail_url();
     $actual = ob_get_clean();
     $this->assertEmpty($actual);
     ob_start();
     the_post_thumbnail_url();
     $actual = ob_get_clean();
     $this->assertEmpty($actual);
     set_post_thumbnail(self::$post, self::$attachment_id);
     ob_start();
     the_post_thumbnail_url();
     $actual = ob_get_clean();
     $this->assertEquals(wp_get_attachment_url(self::$attachment_id), $actual);
 }
开发者ID:inpsyde,项目名称:wordpress-dev,代码行数:20,代码来源:thumbnails.php

示例9: the_ID

<?php 
} else {
    // Set the Featured Image as the Background Image on Archive Pages
    ?>
        
    <article id="post-<?php 
    the_ID();
    ?>
" <?php 
    post_class();
    ?>
 <?php 
    if ('' != get_the_post_thumbnail()) {
        ?>
 style="background: white url(<?php 
        echo the_post_thumbnail_url('jinn-featured-image');
        ?>
);" <?php 
    }
    ?>
>

<?php 
}
?>
        
    <div class="post-content <?php 
echo has_post_thumbnail() ? 'post-thumbnail' : '';
?>
">
开发者ID:jekkilekki,项目名称:theme-jin,代码行数:30,代码来源:content-aside.php

示例10: bloginfo

<div class="top-bar" id="top-bar-menu">
	<div class="top-bar-left float-left">
		<ul class="menu">
			<li class="site-text">
				<?php 
if (is_page_template('page-projects.php') && !is_page('other-projects-of-interest')) {
    ?>
				<a href="<?php 
    bloginfo('url');
    ?>
"><h1 style="background:url(<?php 
    the_post_thumbnail_url('medium');
    ?>
) no-repeat; background-size: contain;"><span class="screen-reader-text"><?php 
    bloginfo('name');
    ?>
</span></h1></a>
				<?php 
} else {
    ?>
					<a href="<?php 
    bloginfo('url');
    ?>
"><h1 style="background:url(<?php 
    echo get_theme_mod('tcx_logo_image');
    ?>
) no-repeat; background-size: contain;"><span class="screen-reader-text"><?php 
    bloginfo('name');
    ?>
</span></h1></a>
开发者ID:alastair38,项目名称:begood2016,代码行数:30,代码来源:nav-offcanvas.php

示例11: array

            $argumentos = array('tag__in' => $tagsIDs, 'post__not_in' => array($post->ID), 'posts_per_page' => 6, 'caller_get_posts' => 1);
            $queryRel = new wp_query($argumentos);
            if ($queryRel->have_posts()) {
                while ($queryRel->have_posts()) {
                    $queryRel->the_post();
                    ?>
								<div class="col-sm-2 col-xs-6 texto-centro">
									<a href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    the_title();
                    ?>
">
										<div class="imagenPR" style="background-image: url('<?php 
                    the_post_thumbnail_url(array(120, 120));
                    ?>
');"></div>
										<h4><?php 
                    the_title();
                    ?>
</h4>
									</a>
								</div>
							<?php 
                }
            }
            $post = $postOriginal;
            wp_reset_query();
        }
        ?>
开发者ID:NativeHex,项目名称:MultiAportes,代码行数:31,代码来源:articulo.php

示例12: get_posts

		<div class="container-fluid recientes">
		<?php 
$original_laPija = $post;
$postRecientes = get_posts('numberposts=5&order=DESC&orderby=date');
foreach ($postRecientes as $post) {
    ?>
				<a href="<?php 
    the_permalink();
    ?>
" title="<?php 
    the_title();
    ?>
">
					<div class="row xxx">
						<div class="col-xs-6 col-sm-4 thmb" style="background-image: url('<?php 
    the_post_thumbnail_url(array(60, 60));
    ?>
');">
						</div>
						<div>
							<p><?php 
    the_title();
    ?>
</p>
						</div>
					</div>
				</a>
		<?php 
}
$post = $original_laPija;
?>
开发者ID:NativeHex,项目名称:MultiAportes,代码行数:31,代码来源:sidebar-principal.php

示例13: get_the_post_thumbnail_url

        $image = get_the_post_thumbnail_url();
        $excerpt = get_the_excerpt();
        $link = get_the_permalink();
        ?>
								<!-- article -->
								<article id="post-<?php 
        the_ID();
        ?>
" <?php 
        post_class();
        ?>
>
									<div class="row no-margin">
										<div class="konkurs clearfix">
											<!-- <div class="col-5 konkurs-left" style="background-image: url(<?php 
        the_post_thumbnail_url('konkurs');
        ?>
 );"> -->
											<div class="col-5 konkurs-left" style="background-image: url('<?php 
        echo $konkurs_list_image ? $konkurs_list_image : get_template_directory_uri() . "/img/post1.jpg";
        ?>
')">
												<div class="konkurs-time pull-left">
												<?php 
        if ($konkurs_time > 0) {
            ?>
													<span>još</span>
													<p><?php 
            echo $konkurs_time;
            ?>
</p>
开发者ID:Mihailo23,项目名称:devet,代码行数:31,代码来源:archive-konkursi.php

示例14: query_posts

<!-- The Query -->
<?php 
query_posts(array('tag' => 'principal', 'posts_per_page' => -1));
?>

<section class="posts row">
<ul id="slider-main">
  <?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>

  <li class="item" data-thumb="<?php 
        the_post_thumbnail_url(array(160, 90));
        ?>
">

  <a href="<?php 
        the_permalink();
        ?>
" id="permalink">

    <?php 
        the_post_thumbnail('full');
        $content = get_the_content();
        $content = trim(preg_replace("/<img[^>]+\\>/i", " ", $content));
        ?>

    <div class="item-info"><?php 
开发者ID:jjcastro,项目名称:mlondono,代码行数:30,代码来源:page-main.php

示例15: the_permalink

        if (is_sticky()) {
            continue;
        }
        ?>
                    <div class='block-thumb col-xs-6  col-md-4 '>
                        <a href='<?php 
        the_permalink();
        ?>
' title="<?php 
        the_permalink();
        ?>
" class='block-avatar col-xs-12'>
                        <?php 
        if (has_post_thumbnail()) {
            echo "<img class='img-responsive center-block thumbnail' src='";
            the_post_thumbnail_url(array(200, 200));
            echo "' alt='";
            the_title();
            echo "' title='";
            the_title();
            echo "' />";
        } else {
            echo "<img class='img-responsive center-block thumbnail' src='' title='404' alt='404' />";
        }
        ?>
                        </a>
                        <div class='block-text col-xs-12'>
                            <div class='intro  center-block text-center'>
                                <?php 
        the_title();
        ?>
开发者ID:duongcuong96,项目名称:my-wp-themes,代码行数:31,代码来源:category.php


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