gpt4 book ai didi

css - 麻烦造型 p 类

转载 作者:太空宇宙 更新时间:2023-11-03 20:02:24 25 4
gpt4 key购买 nike

我在设计样式时遇到问题 <p class="wp-caption-text"> .

我试过了 .detail p.wp-caption-text , .detail .wp-caption-text , .wp-caption-text , 等等。似乎没有任何效果。我错过了什么?

索引.php

<?php get_header(); ?>
<!-- #content -->
<div id="content">
<!-- start of .post -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post<?php if(!has_post_thumbnail()) echo " no-featured"; ?>">
<?php if(has_post_thumbnail()): ?>
<div class="featured">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(array(700,9999)); ?></a>

<div class="credit"></div>
</div>
<?php endif; ?>
<div class="detail">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php if (the_post_thumbnail_caption()) { echo '<p class="wp-caption-text">' . the_post_thumbnail_caption() . '<p>'; }?>
<div class="meta">
<div class="top"></div>
<p><?php _e('by'); ?> <strong><?php the_author(); ?></strong></p>
<p><?php _e('posted'); ?> <strong><?php echo get_the_date(); ?></strong></p>
<p><?php _e('category'); ?> <?php the_category(', '); ?></p>
<div class="bottom"></div>
</div>
<div class="excerpt">
<?php the_excerpt(); ?>
</div>

<?php
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $post->ID
);
$attachments = get_posts($args);
if(count($attachments) > 1):
?>
<div class="pic-excerpt">
<div class="top"></div>
<div class="outer">
<h3><?php _e('Pictures In This Set'); ?></h3>
<div class="pic">
<?php the_image_excerpt(wpop_get_option('pic_excerpt')); ?>
</div>
</div>
<div class="bottom"></div>
</div> <!-- pic-excerpt -->
<?php endif; ?>

</div>
</div>

<?php endwhile;?>
<div class="paging">
<div class="alignleft"><?php next_posts_link('&laquo; Older Entries', 0); ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;', 0); ?></div>
<div class="clear"></div>
</div>
<?php endif;?>
<!-- end of .post -->

Live site.

最佳答案

你没有在这一行结束你的段落标签-

   <?php if (the_post_thumbnail_caption()) { echo '<p class="wp-caption-text">' . the_post_thumbnail_caption() . '<p>'; }?

这里有一个修复

 <?php if (the_post_thumbnail_caption()) { echo '<p class="wp-caption-text">' . the_post_thumbnail_caption() . '</p>'; }?

关于css - 麻烦造型 p 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10903051/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com