我已将主题切换为空白引导主题,但由于主题使用col-sm作为侧边栏,我已经建立的搜索结果列正在弄乱它,并且侧边栏最终位于底部页面。
我的搜索结果的HTML:
<div class="container">
<?php
$i=0;
while ($query->have_posts())
{
if($i%2==0)
echo '<div class="row">';
$query->the_post();
?>
<div class="col-md-6" >
<div style="height:600px">
<h2><a href="<?php the_permalink(); ?>" align="middle"><?php the_title(); ?></a></h2>
<div class="row">
<div class="col-md-6">
<div>
<a href="<?php the_permalink(); ?>">
<?php
if ( has_post_thumbnail() ) {
echo '<p>';
the_post_thumbnail("small");
echo '</p>';
}
?>
</a>
</div>
</div>
<div class="col-md-6">
<div> <?php
echo do_shortcode('[gdrts_stars_rating_auto template="default"
style_type="image" style_image_name="star" alignment="right"]');
?>
</div>
<div class="metatext">
<span>Metascore: </span>
</div>
<?php
$score = get_field('metascore');
if($score < 50) {
$class = "R";
} elseif($score < 75) {
$class = "Y";
} else {
$class = "G";
}
?>
<div class="metacontent<?php echo $class; ?>"><div><span> <?php echo $score; ?> </span></div> </div>
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Payment options</h3>
</div>
<div class="panel-body">
<?php
$field = get_field_object('free');
$value = $field['value'];
$choices = $field['choices'];
if( $value ): ?>
<ul>
<?php foreach( $value as $v ): ?>
<li>
<?php echo $choices[ $v ]; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
</div>
</div>
</div>
<div style="clear: both;">
<p><br /><?php the_excerpt(); ?><p>
</div>
</div>
</div>
<?php
if($i%2!=0)
echo '</div>';
$i++;
}
?>
</div>
Link to site所以你可以亲眼看到它。
我希望侧边栏显示在桌面左侧和手机大小设备的顶部。