我创建了一个页面,其中页面上有各种项目,人们需要通过单击“推荐”对它们进行投票(就像他们在 levi.store.com 上的方式一样)。这些项目根据他们收到的“推荐”数量进行排序。我遇到的问题是这些项目中有 100 个,当我尝试显示它们时,它变得太慢了。有没有办法更有效地做到这一点,这是我所拥有的一些伪代码(我正在使用 Wordpress)
$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>