简体   繁体   中英

Wordpress Index.php blog post

Im struggling structuring my blog post layout. I need to be able to put a form between all my article blog post. I'm not sure how to put the form between all of the post. I'm not sure if this making sense but heres my code. My CSS parents I used flex box

Right layout:

正确的布局预期:

Wrong layout currently I have:

布局错误

Here's my code:

在此处输入图片说明

You store the data in a array variable from the_post() query. You will get the array length and you can use looping such as for loop or while loop. Example:

for ($i=0; $i < $array_length ; $i++) { 
  if ($i == 1){
    //Here you can write the form block
  }
  else{
    //continue to write the post block
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM