• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Grid layout on custom template with CPT in Agency

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: not resolved
  • This topic has 1 reply, 1 voice, and was last updated 10 years, 6 months ago by Michelle Waters.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • March 18, 2013 at 1:12 am #28815
    Michelle Waters
    Participant

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


    Creatorpreneur Collab

    March 18, 2013 at 1:25 am #28822
    Michelle Waters
    Participant

    Here is a link to the page this is on:

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

    Thank you!


    Creatorpreneur Collab

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble