admin管理员组文章数量:1391975
I am trying to make Wordpress theme with bootstrap 3.x. This is my first theme and I am experimenting with Wordpress and bootstrap various features. I would like to use Wordpress sticky post feature to create three side by side columns, but I do not know how to do that. If I use
?php if (have_posts()) : while (have_posts()) : the_post();
$mythemename_post_format = get_post_format();
get_template_part('templates/post', $mythemename_post_format);
<?php endif; ?>
all the posts including those which are checked as sticky posts will appear under the three columns I am taking about.
My plan is to add the codes in the following way:
<div class="row">
<div class="container">
<div class="col-sm-4">
<!—code for the first column—>
</div>
<div class="col-sm-4">
<!—code for the second column—>
</div>
<div class="col-sm-4">
<!—code for the third column—>
</div>
</div>
</div>
Any ideas would be appreciated. Regards
I am trying to make Wordpress theme with bootstrap 3.x. This is my first theme and I am experimenting with Wordpress and bootstrap various features. I would like to use Wordpress sticky post feature to create three side by side columns, but I do not know how to do that. If I use
?php if (have_posts()) : while (have_posts()) : the_post();
$mythemename_post_format = get_post_format();
get_template_part('templates/post', $mythemename_post_format);
<?php endif; ?>
all the posts including those which are checked as sticky posts will appear under the three columns I am taking about.
My plan is to add the codes in the following way:
<div class="row">
<div class="container">
<div class="col-sm-4">
<!—code for the first column—>
</div>
<div class="col-sm-4">
<!—code for the second column—>
</div>
<div class="col-sm-4">
<!—code for the third column—>
</div>
</div>
</div>
Any ideas would be appreciated. Regards
Share Improve this question asked Oct 20, 2015 at 20:18 MikeMike 12 bronze badges1 Answer
Reset to default 0<?php if (have_posts()){ ?>
<?php while(have_posts()){
the_post();
if(is_sticky()){ ?>
<div class="col-sm-4">
<?php //put what you want, Hey you inside the loop now ?>
</div>
<?php }else{
$mythemename_post_format = get_post_format();
get_template_part('templates/post', $mythemename_post_format);
}
} ?>
本文标签: Code for creating three vertical columns in Wordpress Bootstrap theme
版权声明:本文标题:Code for creating three vertical columns in Wordpress Bootstrap theme 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744667587a2618627.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论