Community Forums › Forums › Design Tips and Tricks › Remove featured post from custom category page
This topic contains 2 replies, has 2 voices, and was last updated by snkoura 3 months, 3 weeks ago.
-
AuthorPosts
-
January 2, 2013 at 12:16 am #8898
Greetings and Happy New Year!
I am trying to style a custom category template. I have virtually no experience with php, but found a code snippet that has gotten me pretty close to what I am trying to achieve with some experimental trial and error tweaks. My template however, still shows a single featured post before the grid, and I can’t figure out how to make it go away. Any help would be appreciated!
This is the page. I am trying to rid the page of the featured post at the top and keep the two-column grid of posts.
http://www.smallalien.com/category/small-alien-video/
This is the code I am using:
<?php
/**
* Template Name: videos
*/
remove_action( ‘genesis_loop’, ‘genesis_do_loop’ ); // Remove default loop
//add_action(‘genesis_post_content’,'the_content’); // Adds your custom page code/content before loop
add_action( ‘genesis_loop’, ‘category_page’ ); // Do custom loop
function category_page() {
//add_action(‘genesis_loop’, ‘genesis_standard_loop’);
echo ‘<h1>’;
the_title(); // add title
echo ‘</h1>’;
the_content();
echo ‘<div class=”entry-content”>’;
child_grid_loop_helper();
echo ‘</div<!– end .entry-content –>’ ;
}
function child_grid_loop_helper() {
global $paged;
if (function_exists(‘genesis_grid_loop’)) {
if (function_exists(‘genesis_get_custom_field’)){
$cat = 5; // video category
}
$grid_args_rest = array(
‘features’ => 0,
//’feature_image_size’ => ‘child_full’,
//’feature_image_class’ => ‘aligncenter post-image’,
//’feature_content_limit’ => 100,
//’grid_image_size’ => ‘child_thumb’,
//’grid_image_class’ => ‘aligncenter post-image’,
‘grid_content_limit’ => 150,
//’more’ => ”,
‘posts_per_page’ => 15,
‘post_type’ => ‘post’,
‘cat’ => $cat,
‘paged’ => $paged
);
//assuming that features won’t go beyond 1 page
// genesis_grid_loop( $grid_args_rest );
// /*
if ( ($grid_args_past['paged'] > 1) )
genesis_grid_loop( $grid_args_rest ); //do not show featured after page 1
else {
genesis_grid_loop( $grid_args_rest );
}
//*/
} else {
genesis_standard_loop();
}
}
genesis();Thanks!
January 26, 2013 at 3:22 pm #15090Looks like you got this sorted
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 29, 2013 at 10:30 pm #16311Unfortunately, no. I would like to remove the video at the top and just show the list of thumbnails. Any thoughts would be appreciated
-
AuthorPosts
You must be logged in to reply to this topic.