我在上述图像上有许多容器,例如col-md-10
定义了max-width
80%左右,我是这样生成我的帖子的:
<article id="single-post-<?php the_ID(); ?>" <?php post_class(\'single-post\'); ?>>
<?php
$post_share = new Post_Share( array( \'facebook\', \'twitter\', \'gplus\', \'pinterest\' ), $post, $style = \'share-style-2\' );
echo $post_share->generate_share_links();
?>
<header class="single-post-header">
<div class="single-post-meta">
<?php echo _s_show_post_info( array( \'author\',\'time\', \'category\') ); ?>
</div><!-- .post-meta -->
<?php
the_title( \'<h1 class="single-post-title">\',\'</h1>\' );
if ( has_category() ) : ?>
<?php
$categories = (array) wp_get_post_terms( get_the_ID(), \'category\' );
if ( !is_wp_error( $categories ) && !empty( $categories) ) { ?>
<div class="single-post-secondary-meta">
<span class="single-post-category-span">posted in
<a class="single-post-category" href="<?php echo get_term_link( $categories[0] )?>"><?php echo $categories[0] -> name ?>
</a>
</span>
</div><!-- .post-meta-2 -->
<?php } ?>
<?php endif; ?>
</header><!-- .post-header -->
<?php if ( has_post_thumbnail() ) : ?>
<div class="single-post-thumbnail">
<a class="single-post-thumbnail-link" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail(); ?>
</a>
</div><!-- .post-thimbnail -->
<?php
endif; ?>
<div class="single-post-content">
<?php
//echo wp_trim_words( get_the_content(), 40, \'...\' );
the_content();
?>
</div><!-- .post-content -->
</article><!-- #post-<?php the_ID(); ?> -->
<?php
get_template_part(\'template-parts/individual_post-related-posts\');
?>
具体而言:the_content();
不幸的是,插入图像会导致以下情况:背景.post-content { width: 100%; }
修复了它,但考虑到有很多插件和规则可以重写,这感觉像是一次黑客攻击。我错过了什么,为什么会这样?