Grid layout on custom template with CPT in Agency

Community Forums Forums Design Tips and Tricks Grid layout on custom template with CPT in Agency

This topic is: not resolved

This topic contains 1 reply, has 1 voice, and was last updated by  Just Me 1 year, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #28815

    Just Me
    Participant
    Post count: 23

    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();


    • This topic was modified 1 year, 5 months ago by  Just Me. Reason: corrected formatting
    • This topic was modified 1 year, 5 months ago by  Just Me. Reason: corrected formatting
    #28822

    Just Me
    Participant
    Post count: 23

    Here is a link to the page this is on:

    http://www.techgeekministries.com/learning-center/

    Thank you!


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.