Twitter bootstrap spans in dynamic websites

后端 未结 2 1750
孤城傲影
孤城傲影 2020-12-20 08:24

How am I supposed to generate dynamic rows with a CMS like WordPress?

2条回答
  •  攒了一身酷
    2020-12-20 09:04

    Umm, you don't have nearly enough description of what you are trying to do, so I'll assume you are looping through posts, and have them all stored in the $posts variable, and that the html is in the content property of each $postthis is basically the only direction I can give you:

    $i=0;
    foreach ($posts as $post):
        if ($i%2==0) echo '
    '; echo '
    '. $post->content .'
    '; if ($i%2==1) echo '
    '; $i++; endforeach;

提交回复
热议问题