我已经完成了教程中的三列布局。太好了。但我希望在那个“div”中包含一个样式表。现在我就这样
<div class="post-col1" id="post-125">
<h4 class="member-name"> <a href="/TantraProjects/Ranjit/mdmar/members/tshgueuj/" title="Tshgueuj">Tshgueuj </a> </h4>
<h4 class="phone-number">34543</h4>
</div>
我使用的代码是
<?php if (have_posts ()):?>
<?php $col = 1;
while($loop->have_posts()): $loop->the_post();?>
<?php if ($col == 1)?>
<div class = "post-col<?php echo $col; ?>" id = "post-<?php the_ID();?>" style=" top: 0; left: 305; ">
<h4 class="member-name"> <a href = "<?php the_permalink(); ?>" title = "<?php the_title(); ?>"><?php the_title();?> </a> </h4>
<h4 class="phone-number"><?php echo get_post_meta($post->ID, 'members_phone-one',true) ?></h4>
</div>
<?php
if($col == 1) {$col = 2;} else {
if($col != 1) {
if($col == 3) {$col = 1;}
if($col == 2) {$col = 3;}
}
}
endwhile; ?>
</div>
现在我想在该循环中包含一个样式表。所以我的输出应该是这样的。
<div class="post-col1" id="post-125" style="
top: 0;
left: 0;
">
<h4 class="member-name"> <a href="/TantraProjects/Ranjit/mdmar/members/tshgueuj/" title="Tshgueuj">Tshgueuj </a> </h4>
<h4 class="phone-number">34543</h4>
</div>
<div class="post-col2" id="post-125" style="
top: 0;
left: 300;
">
<h4 class="member-name"> <a href="/TantraProjects/Ranjit/mdmar/members/tshgueuj/" title="Tshgueuj">Tshgueuj </a> </h4>
<h4 class="phone-number">34543</h4>
</div>
<div class="post-col3" id="post-125" style="
top: 0;
left: 600;
">
<h4 class="member-name"> <a href="/TantraProjects/Ranjit/mdmar/members/tshgueuj/" title="Tshgueuj">Tshgueuj </a> </h4>
<h4 class="phone-number">34543</h4>
</div>
<div class="post-col1" id="post-125" style="
top: 300;
left: 0;
">
<h4 class="member-name"> <a href="/TantraProjects/Ranjit/mdmar/members/tshgueuj/" title="Tshgueuj">Tshgueuj </a> </h4>
<h4 class="phone-number">34543</h4>
</div>
<div class="post-col1" id="post-125" style="
top: 300;
left: 600;
">
<h4 class="member-name"> <a href="/TantraProjects/Ranjit/mdmar/members/tshgueuj/" title="Tshgueuj">Tshgueuj </a> </h4>
<h4 class="phone-number">34543</h4>
</div>
我希望这是可以理解的。如果是这样,那么请帮助我。