Community Forums › Forums › Design Tips and Tricks › Grid layout on custom template with CPT in Agency
This topic contains 1 reply, has 1 voice, and was last updated by Tech Geek 2 months ago.
-
AuthorPosts
-
March 18, 2013 at 1:12 am #28815
I would like to have a page on my website that lists in a grid format the featured image, title and price of courses and ebooks that I will be selling. So far, I have created a custom post type, the custom template and managed to make the proper posts show up on the template.
My problem is that the title is showing up before the thumbnail and I don’t have a price showing yet. I assume I need to use a custom field to show the pricing?
I’ll figure that out later when it’s not so late.
What I need help with though is arranging the thumbnail and title properly on the page (and getting rid of the post content, other than the title and featured image.
Here is what I have in my functions.php file:
/** CREATE CUSTOM PAGE TEMPLATE FOR COURSES */
function TGM_edd_custom_loop() {echo '' . get_the_title() . '';
the_content();
//WP Query Start
$per_page = 9;
$courses_args = array(
'post_type' => 'courses',
'posts_per_page' => $per_page,
'paged' => get_query_var( 'paged' )
);
$courses = genesis_custom_loop( $courses_args );
}
And this is what is in my custom page template:
<?php
/**/*
Template Name: TGM Courses
*/// Do the Custom Loop
remove_action('genesis_loop', 'genesis_do_loop');
add_action( 'genesis_loop', 'tgm_custom_loop' );function tgm_custom_loop() {
echo '' . get_the_title() . '';
the_content();//WP Query Start
$per_page = 9;
$courses_args = array(
'post_type' => 'tgm_courses',
'posts_per_page' => $per_page,
'paged' => get_query_var( 'paged' )
);
$courses = genesis_custom_loop( $courses_args );
}//Add Post Class Filter
add_filter('post_class', 'tgm_post_class');
function tgm_post_class($classes) {
global $loop_counter;
$classes[] = 'one-third';
if ($loop_counter % 3 == 0) {
$classes[] .= 'first ';
}
return $classes;
}/** Move Post Info */
remove_action('genesis_before_post_content','genesis_post_info');
remove_action('genesis_after_post_content','genesis_post_meta');genesis();
Michelle Waters
TechGeekMinistries.com-
This topic was modified 2 months ago by
Tech Geek. Reason: corrected formatting
-
This topic was modified 2 months ago by
Tech Geek. Reason: corrected formatting
March 18, 2013 at 1:25 am #28822Here is a link to the page this is on:
http://www.techgeekministries.com/learning-center/
Thank you!
Michelle Waters
TechGeekMinistries.com -
This topic was modified 2 months ago by
-
AuthorPosts
You must be logged in to reply to this topic.