wordpress - 如何在我的缩略图上放置文本和阴影 (php)?

标签 wordpress list thumbnails css

我有一个缩略图的结果列表,下面有文字。我想将文本设置为白色,并在缩略图的底部加上一个阴影矩形。任何人都知道如何在下面的代码中实现这一点?

提前致谢:)

 <?php if ( have_posts() ) : ?>

<div id="page-<?php echo $paged ?>">


    <?php while ( have_posts() ) : the_post(); ?>

        <?php
        if ( get_post_meta($post->ID, 'location', true) )
            $make_address = get_post_meta($post->ID, 'location', true);
        else
            $make_address = get_post_meta($post->ID, 'cp_street', true) . '&nbsp;' . get_post_meta($post->ID, 'cp_city', true) . '&nbsp;' . get_post_meta($post->ID, 'cp_state', true) . '&nbsp;' . get_post_meta($post->ID, 'cp_zipcode', true);
        ?>

        <div id="post-id-<?php the_ID(); ?>" class="post-wrapper">

            <div class="post-block">
                <?php if ( is_sticky() ) echo '<strong>FEATURED</strong>'; ?>

             <div class="grid_100">
             <?php if ( get_option('cp_ad_images') == 'yes' ) cp_ad_loop_thumbnail(); ?>

                <h3 class="post-title"><a href="<?php the_permalink(); ?>"><?php if ( mb_strlen( get_the_title() ) >= 75 ) echo mb_substr( get_the_title(), 0, 75 ).'...'; else the_title(); ?></a></h3>
        </div>
        <div class="post-desc">
        <?php echo $make_address; ?>
                    <div class="post-debug">

                        <!--<h4>Description:</h4>
                        <?php echo cp_get_content_preview( 160 ); ?>--!>
                    </div>
                </div>
            </div><!-- /post-block -->
        </div><!-- /post-wrapper -->

    <?php endwhile; ?>

</div><!-- /page --> 

<?php else: ?>

    <div class="block"><center>Sorry, no results found...</center></div>

<?php endif; ?>

最佳答案

这不是 Wordpress 的问题,您需要使用 CSS 来解决这个问题。尝试 box-shadow在缩略图上创建阴影。

关于wordpress - 如何在我的缩略图上放置文本和阴影 (php)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16699278/

相关文章:

jQuery 无限缩略图库

.net - 是否可以使用 Azure Web 应用程序服务来托管 .NET Core Web 应用程序以及 Wordpress 平台?

php - 在单个帖子页面上输出自定义分类法名称 - wordpress

python - 使用 XOR 运算符确定整数列表中是否存在重复项

list - dart - 如果包含在列表中,如何检查 id/name?

css - 无序列表中的奇怪空间

html - 如何在 Bootstrap 缩略图类中添加自动滚动

javascript - XMLHTTPRequest 发送数据

css - 自定义 CSS 以创建 WordPress 下拉菜单

python - 有没有一种使用范围创建元组列表的有效方法?