1
我创建了一个页面,其中有一个页面上有不同的项目,人们需要通过点击“推荐”来对它们进行投票(比如他们如何在levi.store.com上进行投票) 。这些项目根据他们收到的“建议”数量进行排序。我遇到的问题是有100个这样的项目,当我尝试显示它们时,它变得太慢了。有没有办法更有效地做到这一点,这是什么,我有一些伪代码(我使用WordPress的)一个页面上的几个Facebook像按钮的帮助
$theCategory = 'the-item-category'; //every item is a post and is placed into this category
$items->query('cat='.$theCategory); //this gets all those items in that category
while($items->have_posts()) : $items->the_post();
<h1><?php the_title(); ?></h1>
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&layout=button_count&show_faces=false&width=450&action=recommend&font&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:140px; height:21px;" allowTransparency="true"></iframe>
你能告诉我们你的SQL吗? – Babiker 2010-06-04 01:22:12
我只是使用内置的Wordpress查询函数来发布帖子 - > http://codex.wordpress.org/The_Loop – fewpeople 2010-06-04 01:29:12