Skip to content

Instantly share code, notes, and snippets.

@tenman
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenman/9341614 to your computer and use it in GitHub Desktop.
Save tenman/9341614 to your computer and use it in GitHub Desktop.
Raindrops template shows category name and post links
<?php
/*
* Template Name: test
*/
get_header('html5');
?><div style="margin:5%;-moz-columns: 15em auto;-webkit-columns:15em auto;-o-columns: 15em auto;-ms-columns: 15em auto;">
<?php
$categories = get_all_category_ids();
$output = '';
if($categories){
foreach($categories as $cat_id) {
$cat_name = get_cat_name($cat_id);
echo '<h2>'.$cat_name.'</h2>';
echo do_shortcode('[catlist name='.$cat_name.']');
}
}
?></div>
<?php
get_footer();
?>
@tenman
Copy link
Author

tenman commented Mar 4, 2014

[catlist name='.$cat_id.'] is wrong
[catlist name='.$cat_name.'] correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment