• I would like to create a new page with the same layout as the homepage grids but filtered on the post category. Ideas? I’ve created a new Page Template and tried to filter using the category ID however it doesn’t seem to work. I could get it to filter just the WordPress Loop however I like the grid layout.

    Manually inserting the contents of Content.php hasn’t been going so well.

    Thoughts? Below is the code I have so far (please disregard the “mobiletop” and “desktoptop” divs as I use those to set specific anchors when users navigate):

    <?php /* Template Name: New Page Template */ ?>
    <?php
    /**
     * @package Gridster
     */
    ?>
    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    
    <div id="main">
    
    <?php   query_posts('cat=169'); ?>
    <?php if ( have_posts() ) : ?>
    <?php /* Start the Loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?>
    <div id="post-<?php the_ID(); ?>" <?php post_class("poste"); ?>> <a href="<?php the_permalink(); ?>" rel="bookmark">
    <?php if ( has_post_thumbnail() ) {
    the_post_thumbnail('post-thumb', array('class' => 'postimg'));
    } else { ?>
    <img src="<?php echo esc_url( get_template_directory_uri() ); ?>/img/defaultthumb.png" class="postimg" alt="<?php the_title(); ?>" /><?php } ?>
    </a>
    	
    <div id="mobiletop">
    <div class="portfoliooverlay"><a href="<?php the_permalink(); ?>#m"><!--<span>+</span>--></a></div>
    </div>
    <div id="desktoptop">
    <div class="portfoliooverlay"><a href="<?php the_permalink(); ?>"><!--<span>+</span>--></a></div>
    </div>
    <h2 id="mobiletop" class="posttitle"><a href="<?php the_permalink(); ?>#m" rel="bookmark">
    <?php the_title(); ?>
    </a></h2>
    <h2 id="desktoptop" class="posttitle"><a href="<?php the_permalink(); ?>" rel="bookmark">
    <?php the_title(); ?>
    </a></h2>
    
    <p class="postmeta">
    <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
    <?php
    				/* translators: used between list items, there is a space after the comma */
    				$categories_list = get_the_category_list( __( ', ', 'gridster-lite' ) );
    				if ( $categories_list && gridster_categorized_blog() ) :
    			?>
    <?php printf( __( '%1$s', 'gridster-lite' ), $categories_list ); ?>
    <?php endif; // End if categories ?>
    <?php endif; // End if 'post' == get_post_type() ?>
    </p>
    	
    </div> <!-- content -->
    
    <?php endwhile; // end of the loop. ?>
    <?php get_footer(); ?>
  • The topic ‘Duplicate homepage grid and filter’ is closed to new replies.