如何在页脚的每 10 个列表项之后创建一个新行
我想将列表项分成特定宽度内的第二列,这样如果它有 100 个列表项,那么它将创建 5 列和 20 个原始列表项。
看起来像 http://www.huffingtonpost.com/ (链接)
我的 CSS 是:
.footer-item {
float: left;
width: 31%;
padding-bottom: 10px;
padding-left: 20px;
font-size: 14px;
font-weight: 700;
text-transform: uppercase;
}
.footer-item ul {
font-size: 12px;
text-transform: none;
font-weight: normal;
}
和我的 WordPress PHP代码是
</div>
<!-- end content-wrap -->
</div>
<!-- end main-wrap -->
<div id="footer">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Footer") ) : ?>
<div class="footer-item">
<h3>Bookmarks</h3>
<ul>
<?php wp_list_bookmarks('title_li=&categorize=0&limit=10'); ?>
</ul>
</div>
<div class="footer-item">
<h3>Monthy Archives</h3>
<ul>
<?php wp_get_archives('limit=10'); ?>
</ul>
</div>
<div class="footer-item">
<h3>Daily Archives</h3>
<ul>
<?php wp_get_archives('type=daily&limit=10'); ?>
</ul>
</div>
<?php endif; ?>
<div class="clear"></div>
<div id="subscribe">
<h4><img src="<?php bloginfo('template_directory'); ?>/images/feed.png" alt="Subscribe to RSS" /> Subscribe</h4>
<p>Subscribe to <a href="<?php bloginfo('rss2_url'); ?>">RSS</a> or enter you email to receive newsletter for news, articles, and updates about what's new.</p>
<form action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=<?php echo get_option('feedmail'); ?>', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">
<input type="text" onblur="if (this.value == '') {this.value = 'enter your email...';}" onfocus="if (this.value == 'enter your email...') {this.value = '';}" value="enter your email..." name="semail" id="semail" />
<input type="hidden" value="<?php echo get_option('feedmail'); ?>" name="uri"/>
<input type="hidden" name="loc" value="en_US"/>
<input type="submit" id="submit" value="Subscribe" />
</form>
</div>
<div id="footer_right">
<ul>
<li> <a href="<?php echo get_option('home'); ?>">Home</a></li>
<?php wp_list_pages('title_li='); ?>
</ul>
<small> Copyright © <a href="<?php echo get_option('home'); ?>/" class="on">
<?php bloginfo('name'); ?>
</a> <?php echo date("Y",time()+(7*24*60*60)); ?>. All Rights Reserved.</small><br />
<small><a href="http://www.wordpress.com/">wordpress</a> theme by <a href="http://www.wordpress.com">wordpress</a></small> </div>
</div>
<!-- end footer -->
<?php } ?>
<?php wp_footer(); ?>
I want to break my list items to second column within a particular width so that if its 100 list items then it will create 5 column and 20 raw.
something looks like http://www.huffingtonpost.com/ (LINKS)
My CSS is :
.footer-item {
float: left;
width: 31%;
padding-bottom: 10px;
padding-left: 20px;
font-size: 14px;
font-weight: 700;
text-transform: uppercase;
}
.footer-item ul {
font-size: 12px;
text-transform: none;
font-weight: normal;
}
And My Wordpress PHP Code is
</div>
<!-- end content-wrap -->
</div>
<!-- end main-wrap -->
<div id="footer">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Footer") ) : ?>
<div class="footer-item">
<h3>Bookmarks</h3>
<ul>
<?php wp_list_bookmarks('title_li=&categorize=0&limit=10'); ?>
</ul>
</div>
<div class="footer-item">
<h3>Monthy Archives</h3>
<ul>
<?php wp_get_archives('limit=10'); ?>
</ul>
</div>
<div class="footer-item">
<h3>Daily Archives</h3>
<ul>
<?php wp_get_archives('type=daily&limit=10'); ?>
</ul>
</div>
<?php endif; ?>
<div class="clear"></div>
<div id="subscribe">
<h4><img src="<?php bloginfo('template_directory'); ?>/images/feed.png" alt="Subscribe to RSS" /> Subscribe</h4>
<p>Subscribe to <a href="<?php bloginfo('rss2_url'); ?>">RSS</a> or enter you email to receive newsletter for news, articles, and updates about what's new.</p>
<form action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=<?php echo get_option('feedmail'); ?>', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">
<input type="text" onblur="if (this.value == '') {this.value = 'enter your email...';}" onfocus="if (this.value == 'enter your email...') {this.value = '';}" value="enter your email..." name="semail" id="semail" />
<input type="hidden" value="<?php echo get_option('feedmail'); ?>" name="uri"/>
<input type="hidden" name="loc" value="en_US"/>
<input type="submit" id="submit" value="Subscribe" />
</form>
</div>
<div id="footer_right">
<ul>
<li> <a href="<?php echo get_option('home'); ?>">Home</a></li>
<?php wp_list_pages('title_li='); ?>
</ul>
<small> Copyright © <a href="<?php echo get_option('home'); ?>/" class="on">
<?php bloginfo('name'); ?>
</a> <?php echo date("Y",time()+(7*24*60*60)); ?>. All Rights Reserved.</small><br />
<small><a href="http://www.wordpress.com/">wordpress</a> theme by <a href="http://www.wordpress.com">wordpress</a></small> </div>
</div>
<!-- end footer -->
<?php } ?>
<?php wp_footer(); ?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想这就是你想要的:
http://jsfiddle.net/383uF/4/
希望这个有帮助,但请详细说明。:)
I think this is what you want:
http://jsfiddle.net/383uF/4/
Hope this helps but otherwise please elaborate.:)