Skip to content

Instantly share code, notes, and snippets.

@kingsidharth
Created May 11, 2012 10:03
Show Gist options
  • Save kingsidharth/2658719 to your computer and use it in GitHub Desktop.
Save kingsidharth/2658719 to your computer and use it in GitHub Desktop.
<?php
$loopty_loop = new my_loops;
class my_loops extends thesis_custom_loop {
function home() {
echo "<div class=\"post_box top\">\n";
echo "\t<div class=\"format_text\">\n";
echo "\t\t<ul>\n";
while (have_posts()) {
the_post();
echo "\t\t\t<li><a href=\"" . get_permalink() . "\">" . get_the_title() . "</a></li>\n";
}
echo "\t\t</ul>\n";
# category
echo "\t\t<ul>";
$categories= get_categories('hide_empty=1&orderby=count');
foreach ($categories as $category) {
if($category->slug != "uncategorized") {
echo "<div class=\"category_list\" id=\"" . $category->slug . "\">";
echo "<h2>" . $category->name . "</h2>";
echo "<ul class=\"post_list\">";
query_posts('category_name='. $category->slug .'&posts_per_page=10');
while (have_posts()) {
the_post();
echo "\t\t\t<li>";
$post_image = thesis_post_image_info('thumb');
echo $post_image['output'];
echo "<a href=\"" . get_permalink() . "\">" . get_the_title() . "</a>";
echo "<span class=\"author\">by ";
echo the_author('');
echo "</span>";
echo "</li>\n";
}
echo "</ul>";
echo "</div><!-- category_list -->";
}
}
echo "</ul>";
echo "\t</div>\n";
echo "</div>\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment