admin管理员组文章数量:1130349
hello i try to display my post into a div grid of 3 columns with the code
<div class="Jobs">
<?php
if(have_posts()) {
while (have_posts()) {
echo'<div class="info_Job">';
echo '<h2>',the_title(),'</h2>';
echo the_post_thumbnail(),'</div>';
the_post();
}
}
?>
</div>
but instead to correctly display the 3 differents post y 2 of the same post and another like below
how can i correct this please
hello i try to display my post into a div grid of 3 columns with the code
<div class="Jobs">
<?php
if(have_posts()) {
while (have_posts()) {
echo'<div class="info_Job">';
echo '<h2>',the_title(),'</h2>';
echo the_post_thumbnail(),'</div>';
the_post();
}
}
?>
</div>
but instead to correctly display the 3 differents post y 2 of the same post and another like below
how can i correct this please
Share Improve this question asked Nov 12, 2018 at 21:55 matthias screedmatthias screed 171 silver badge4 bronze badges 1- Suggest posting the CSS for the classes in your code. The CSS will be important in how the content is displayed inside the divs. And, you might consider using a CSS Grid container, so that the display will be responsive. CSS Grid is quite clever in how it will display items, but will require a bit of research and testing. (I'm just learning it myself, so have no specific answers.) – Rick Hellewell Commented Nov 13, 2018 at 1:54
1 Answer
Reset to default 0you're using commas as concatenators
you're echoing the_title() and the_post_thumbnail() (use get if you're
echoing)
your the_post() was at the bottom
<div class="Jobs">
<?php
if(have_posts()) {
while (have_posts()) {
the_post();
echo'<div class="info_Job">';
echo '<h2>'.get_the_title().'</h2>';
echo get_the_post_thumbnail().'</div>';
}
}
?>
</div>
If you don't want to use get but directly output do this instead:
<div class="Jobs">
<?php
if(have_posts()) {
while (have_posts()) {
the_post();?>
<div class="info_Job">
<h2><?php the_title();?></h2>
<?php the_post_thumbnail();?>
</div>
<?php }
}
?>
</div>
hello i try to display my post into a div grid of 3 columns with the code
<div class="Jobs">
<?php
if(have_posts()) {
while (have_posts()) {
echo'<div class="info_Job">';
echo '<h2>',the_title(),'</h2>';
echo the_post_thumbnail(),'</div>';
the_post();
}
}
?>
</div>
but instead to correctly display the 3 differents post y 2 of the same post and another like below
how can i correct this please
hello i try to display my post into a div grid of 3 columns with the code
<div class="Jobs">
<?php
if(have_posts()) {
while (have_posts()) {
echo'<div class="info_Job">';
echo '<h2>',the_title(),'</h2>';
echo the_post_thumbnail(),'</div>';
the_post();
}
}
?>
</div>
but instead to correctly display the 3 differents post y 2 of the same post and another like below
how can i correct this please
Share Improve this question asked Nov 12, 2018 at 21:55 matthias screedmatthias screed 171 silver badge4 bronze badges 1- Suggest posting the CSS for the classes in your code. The CSS will be important in how the content is displayed inside the divs. And, you might consider using a CSS Grid container, so that the display will be responsive. CSS Grid is quite clever in how it will display items, but will require a bit of research and testing. (I'm just learning it myself, so have no specific answers.) – Rick Hellewell Commented Nov 13, 2018 at 1:54
1 Answer
Reset to default 0you're using commas as concatenators
you're echoing the_title() and the_post_thumbnail() (use get if you're
echoing)
your the_post() was at the bottom
<div class="Jobs">
<?php
if(have_posts()) {
while (have_posts()) {
the_post();
echo'<div class="info_Job">';
echo '<h2>'.get_the_title().'</h2>';
echo get_the_post_thumbnail().'</div>';
}
}
?>
</div>
If you don't want to use get but directly output do this instead:
<div class="Jobs">
<?php
if(have_posts()) {
while (have_posts()) {
the_post();?>
<div class="info_Job">
<h2><?php the_title();?></h2>
<?php the_post_thumbnail();?>
</div>
<?php }
}
?>
</div>
本文标签: csshow can i fix my display post in my indexphp
版权声明:本文标题:css - how can i fix my display post in my index.php 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749187496a2329631.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论