[Resolved] Course Page & Custom Fields

Home Forums Support [Resolved] Course Page & Custom Fields

Home Forums Support Course Page & Custom Fields

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1063778
    fabiosilva

    Hi,
    I want to use GP to the academy website project and one of the challenges is creating the course pages.
    Will there be any method in GP (or using any plugin) that will allow me to use custom fields to enter standard information for each course?

    For example, hours, dates, titles, description, etc.

    Thank you.

    #1064112
    David
    Staff
    Customer Support

    Hi there,

    for courses i would recommend using a LMS plugin such as Lifter LMS and LearnDash. It takes all the grunt work out of setting up courses with CPT or Custom Fields.

    #1064128
    fabiosilva

    Hi,

    Actually, we desire something really simple (show courses descriptios and call-to-action form).

    A LMS system is to much for this project. My idea is create a standar page, and use Custom Fields to introduce data. I don’t know if this will be possible.

    Thank you.

    #1064154
    David
    Staff
    Customer Support

    OK – so how do you plan on adding the Custom Fields ? Is this via the core WP Custom fields or using something like ACF?

    Either one of them can be displayed within the post template using the Hook Element.

    Let me know.

    #1064165
    fabiosilva

    Humm.
    Via core WP Custom fields (But I will explore the ACF possibility).

    Using Hook Element to display data, sounds good! I can make this perfectly!

    But, what code should I use to get the “custom field”?

    I thin it’s possibe use HTML on WP Custom fields

    #1064182
    David
    Staff
    Customer Support

    So here’s an example for a custom field called hours

    <?php 
    
    // Create variable to get the customfield value
    $hoursfield = get_post_meta($post->ID, 'hours', true);
     // Check the variable is not empty
    if ($hoursfield { ?>
        
        <span class="custom-class-for-styling" itemprop="time"><? echo $hoursfield; ?></span>
     
    <?php 
     
    }
     
    ?>

    And for further reading:
    https://developer.wordpress.org/reference/functions/get_post_meta/

    #1064187
    fabiosilva

    Nice! I will check, but I’m sure that this is perfect for me. 🙂

    Thank you, David!

    #1064188
    David
    Staff
    Customer Support

    You’re welcome

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.