[ create a new paste ] login | about

Link: http://codepad.org/xQE0tjfi    [ raw code | output | fork ]

PHP, pasted on Feb 5:
<?php
/**
 * The template for displaying Category pages.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Pronto
 * @since Pronto 1.0
 */

get_header(); ?>
	<div class="row" role="main">

	<header>
		<h1><?php echo single_cat_title( '', false ); ?></h1>
		<?php if ( category_description() ) : // Show an optional category description ?>
		<div><?php echo category_description(); ?></div>
		<?php endif; ?>
	</header><!-- .archive-header -->
	</div>
	
	<div style="clear:both;">&nbsp;</div>
	
	
<?php if (is_category()) 
{

$category_id = get_query_var('cat');

    if ($category_id == '27' || $category_id == '24' || $category_id == '23') { ?>
		
	<ul>
	<!-- THIS ISN'T WORKING --->
		<?php wp_list_categories('orderby=id&show_count=1&use_desc_for_title=0&child_of=$category_id'); ?>
	</ul>
		
    <? }
    else {
		$counter = 1; //start counter

		$grids = 4; //Grids per row

		global $query_string; //Need this to make pagination work


		/*Setting up our custom query (In here we are setting it to show 12 posts per page and eliminate all sticky posts) */
		query_posts($query_string . '&caller_get_posts=1&posts_per_page=12');


		if(have_posts()) :	while(have_posts()) :  the_post(); 

		if($counter==1)
			print "<div class=\"row\" style=\"margin-bottom:25px;\">";

		?>
					<div class="col-sm-6 col-md-3 grid" style="text-align: center;">
						<div class="postimage" style="display:table; margin:auto;">
							<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" style="display:table-cell; vertical-align:middle;"><?php the_post_thumbnail('thumbnail'); ?></a>
						</div>
						<div class="posttitle">
						<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
						</div>
					</div>
		<?php
		if($counter == $grids) {
			print "</div>";
			$counter = 1;
		} else {
			$counter++;
		}
		endwhile;
		//Pagination can go here if you want it.
		endif;
	}
	
} ?>		
<!-- #content -->


<?php get_footer(); ?>


Output:
1
2

Fatal error: Call to undefined function get_header() on line 12


Create a new paste based on this one


Comments: