Support

Account

Forum Replies Created

  • Display is controlled for the custom post type “course”:

    <?php
    /**
    * The Template for displaying all single courses. Nimmo version
    *
    * @package WordPress
    * @subpackage Twenty_Eleven
    * @since Twenty Eleven 1.0
    */

    wp_enqueue_style(‘courses’, get_stylesheet_directory_uri() . ‘/lib/courses/courses.css’);

    function nim_courses_content($content){

    // render the ACF plugin fields.

    if ( function_exists( ‘the_field’ ) ) {

    // Print the CCSS/CCR logo if selected
    $standard = (get_field(‘standard’));

    if (!empty($standard)) {
    echo ‘<div class=”standards-wrap”>’;

    if( in_array( ‘College & Career Ready’, $standard ) ) echo ‘<div class=”ccr-logo”></div>’;
    if( in_array( ‘Common Core’, $standard ) ) echo ‘<div class=”ccss-logo”></div>’;

    echo ‘</div>’;
    }

    if (get_field( ‘course_description’ )) { ?>
    <div class=”course-field-wrap”>

    <div class=”course-field-title”>
    <?php $field_object = get_field_object( ‘course_description’ ); ?>
    <h3><?php echo $field_object[‘label’]; ?></h3>
    </div> <!– .course-field-title –>

    <div class=”course-field-value”>
    <?php the_field( ‘course_description’ ); ?>
    </div> <!– .course-field-value –>

    </div> <!– .course-field-wrap –> <?php
    }

    if (get_field( ‘learning_outcomes’ )) { ?>
    <div class=”course-field-wrap”>

    <div class=”course-field-title”>
    <?php $field_object = get_field_object( ‘learning_outcomes’ ); ?>
    <h3><?php echo $field_object[‘label’]; ?></h3>
    </div> <!– .course-field-title –>

    <div class=”course-field-value”>

      <?php while( has_sub_field( ‘learning_outcomes’ )):

      echo “

    • “. get_sub_field( ‘outcome’ ) . “
    • “;

      endwhile; ?>

    </div> <!– .course-field-value –>

    </div> <!– .course-field-wrap –> <?php
    }

    if (get_field( ‘target_audiences’ )) { ?>
    <div class=”course-field-wrap”>

    <div class=”course-field-title”>
    <?php $field_object = get_field_object( ‘target_audiences’ ); ?>
    <h3><?php echo $field_object[‘label’]; ?></h3>
    </div> <!– .course-field-title –>

    <div class=”course-field-value”>
    <?php the_field( ‘target_audiences’ ); ?>
    </div> <!– .course-field-value –>

    </div> <!– .course-field-wrap –> <?php
    }

    if (get_field( ‘format’ )) { ?>
    <div class=”course-field-wrap”>

    <div class=”course-field-title”>
    <?php $field_object = get_field_object( ‘format’ ); ?>
    <h3><?php echo $field_object[‘label’]; ?></h3>
    </div> <!– .course-field-title –>

    <div class=”course-field-value”>
    <?php the_field( ‘format’ ); ?>
    </div> <!– .course-field-value –>

    </div> <!– .course-field-wrap –> <?php
    }

    if (get_field( ‘grades’ )) { ?>
    <div class=”course-field-wrap”>

    <div class=”course-field-title”>
    <?php $field_object = get_field_object( ‘grades’ ); ?>
    <h3><?php echo $field_object[‘label’]; ?></h3>
    </div> <!– .course-field-title –>

    <div class=”course-field-value”>
    <?php the_field( ‘grades’ ); ?>
    </div> <!– .course-field-value –>

    </div> <!– .course-field-wrap –> <?php
    }

    if (get_field( ‘prerequisites_required’ )) { ?>
    <div class=”course-field-wrap”>

    <div class=”course-field-title”>
    <?php $field_object = get_field_object( ‘prerequisites_required’ ); ?>
    <h3><?php echo $field_object[‘label’]; ?></h3>
    </div> <!– .course-field-title –>

    <div class=”course-field-value course-field-fullwidth”>
    <?php
    $courseIDs = get_field( ‘prerequisites_required’ );
    foreach( $courseIDs as $courseID ) {

    echo ‘‘ . get_the_title($courseID) . ‘<br />’;
    } ?>
    </div> <!– .course-field-value –>

    </div> <!– .course-field-wrap –> <?php
    }

    if (get_field( ‘related_courses’ )) { ?>
    <div class=”course-field-wrap”>

    <div class=”course-field-title”>
    <?php $field_object = get_field_object( ‘related_courses’ ); ?>
    <h3><?php echo $field_object[‘label’]; ?></h3>
    </div> <!– .course-field-title –>

    <div class=”course-field-value course-field-fullwidth”>
    <?php
    $courseIDs = get_field( ‘related_courses’ );
    foreach( $courseIDs as $courseID ) {

    echo ‘‘ . get_the_title($courseID) . ‘<br />’;
    } ?>
    </div> <!– .course-field-value –>

    </div> <!– .course-field-wrap –> <?php
    }

    if (get_field( ‘next_steps’ )) { ?>
    <div class=”course-field-wrap”>

    <div class=”course-field-title”>
    <?php $field_object = get_field_object( ‘next_steps’ ); ?>
    <h3><?php echo $field_object[‘label’]; ?></h3>
    </div> <!– .course-field-title –>

    <div class=”course-field-value course-field-fullwidth”>
    <?php
    $courseIDs = get_field( ‘next_steps’ );
    foreach( $courseIDs as $courseID ) {

    echo ‘‘ . get_the_title($courseID) . ‘<br />’;
    } ?>
    </div> <!– .course-field-value –>

    </div> <!– .course-field-wrap –> <?php
    }

    if (get_field( ‘downloadables’ )) { ?>
    <div class=”course-field-wrap”>

    <div class=”course-field-title”>
    <?php $field_object = get_field_object( ‘downloadables’ ); ?>
    <h3><?php echo $field_object[‘label’]; ?></h3>
    </div> <!– .course-field-title –>

    <div class=”course-field-value course-field-fullwidth”>
    <?php

    while( has_sub_field( ‘downloadables’ )):

    $fileID = get_sub_field( ‘file’ );
    $title = get_sub_field( ‘title’ );
    echo ‘‘ . $title . ‘<br />’;

    endwhile; ?>
    </div> <!– .course-field-value –>

    </div> <!– .course-field-wrap –> <?php
    }

    if (get_field( ‘purchasables’ )) { ?>
    <div class=”course-field-wrap”>

    <div class=”course-field-title”>
    <?php $field_object = get_field_object( ‘purchasables’ ); ?>
    <h3><?php echo $field_object[‘label’]; ?></h3>
    </div> <!– .course-field-title –>

    <div class=”course-field-value course-field-fullwidth”>
    <?php

    while( has_sub_field( ‘purchasables’ )):

    $url = esc_url( get_sub_field( ‘url’ ) );
    $title = get_sub_field( ‘link_title’ );
    echo ‘‘ . $title . ‘<br />’;

    endwhile; ?>
    </div> <!– .course-field-value –>

    </div> <!– .course-field-wrap –> <?php
    }

    if (get_field( ‘specials’ )) { ?>
    <div class=”course-field-wrap”>

    <div class=”course-field-title”>
    <?php $field_object = get_field_object( ‘specials’ ); ?>
    <h3><?php echo $field_object[‘label’]; ?></h3>
    </div> <!– .course-field-title –>

    <div class=”course-field-value”>
    <?php the_field( ‘specials’ ); ?>
    </div> <!– .course-field-value –>

    </div> <!– .course-field-wrap –> <?php
    }

    if (get_field( ‘item_number’ )) { ?>
    <div class=”course-field-wrap”>

    <div class=”course-field-title”>
    <?php $field_object = get_field_object( ‘item_number’ ); ?>
    <h3><?php echo $field_object[‘label’]; ?></h3>
    </div> <!– .course-field-title –>

    <div class=”course-field-value”>
    <?php the_field( ‘item_number’ ); ?>
    </div> <!– .course-field-value –>

    </div> <!– .course-field-wrap –> <?php
    }

    if (get_field( ‘price’ )) { ?>
    <div class=”course-field-wrap”>

    <div class=”course-field-title”>
    <?php $field_object = get_field_object( ‘price’ ); ?>
    <h3><?php echo $field_object[‘label’]; ?></h3>
    </div> <!– .course-field-title –>

    <div class=”course-field-value”>
    <?php echo “\$” . get_field( ‘price’ ); ?>
    </div> <!– .course-field-value –>

    </div> <!– .course-field-wrap –> <?php
    }

    if (get_field( ‘participants’ )) { ?>
    <div class=”course-field-wrap”>

    <div class=”course-field-title”>
    <?php $field_object = get_field_object( ‘participants’ ); ?>
    <h3><?php echo $field_object[‘label’]; ?></h3>
    </div> <!– .course-field-title –>

    <div class=”course-field-value”>
    <?php the_field( ‘participants’ ); ?>
    </div> <!– .course-field-value –>

    </div> <!– .course-field-wrap –> <?php
    }

    }

    echo ‘<br />’;

    //echo $content;
    }

    add_filter(‘the_content’, ‘nim_courses_content’);

    get_header(); ?>

    <div id=”primary”>
    <?php get_sidebar(‘what-we-offer’); ?>
    <div id=”content” role=”main”>

    <?php while ( have_posts() ) : the_post(); ?>

    <nav id=”nav-single”>
    <h3 class=”assistive-text”><?php _e( ‘Post navigation’, ‘twentyeleven’ ); ?></h3>
    <span class=”nav-previous”><?php previous_post_link( ‘%link’, __( ‘<span class=”meta-nav”>←</span> Previous’, ‘twentyeleven’ ) ); ?></span>
    <span class=”nav-next”><?php next_post_link( ‘%link’, __( ‘Next <span class=”meta-nav”>→</span>’, ‘twentyeleven’ ) ); ?></span>
    </nav><!– #nav-single –>

    <?php get_template_part( ‘content-single’, get_post_format() ); ?>

    <?php endwhile; // end of the loop. ?>

    </div><!– #content –>
    <?php get_sidebar(‘courses’); ?>
    </div><!– #primary –>

    <?php get_footer(); ?>

  • Field Order
    Field Label
    Field Name
    Field Type

    1 Standard (javascript:;)

    standard
    Checkbox

    2 Course Description (javascript:;)

    course_description
    Wysiwyg Editor

    3 Learning Outcomes (javascript:;)

    learning_outcomes
    Repeater

    4 Target Audiences (javascript:;)

    target_audiences
    Checkbox

    5 Format (javascript:;)

    format
    Checkbox

    6 Grades (javascript:;)

    grades
    Checkbox

    7 Pre-Requisites (javascript:;)

    prerequisites
    Post Object

    8 Recommended & Related Courses (javascript:;)

    related_courses
    Post Object

    9 Next Steps (javascript:;)

    next_steps
    Post Object

    10 Agenda (javascript:;)

    downloads
    Repeater

    11 Recommended Resources (javascript:;)

    resources
    Repeater

    12 Specials (javascript:;)

    specials
    Wysiwyg Editor

    13 Item Number (javascript:;)

    item_number
    Number

    14 Price (javascript:;)

    price
    Text

    15

    Text

    Drag and drop to reorder
    + Add Field (javascript:;)

    Location
    Rules

    Create a set of rules to determine which edit screens will use these advanced custom fields

    Show this field group if
    Post TypeLogged in User TypePagePage TypePage ParentPage TemplatePostPost CategoryPost FormatPost StatusPost TaxonomyAttachmentTermUser
    is equal tois not equal to
    postpagecoursewpcf7_contact_formslide
    and (http://mathsolutions.com/wp-admin/post.php?post=2296&action=edit#)

    or
    Add rule group (http://mathsolutions.com/wp-admin/post.php?post=2296&action=edit#)

    Options
    Order No.

    Field groups are created in order
    from lowest to highest

    Position
    High (after title)
    Normal (after content)
    Side

    Style
    No Metabox
    Standard Metabox

    Hide on screen

    Select items to hidethem from the edit screen

    If multiple field groups appear on an edit screen, the first field group’s options will be used. (the one with the lowest order number)

    Content Editor
    Excerpt
    Custom Fields
    Discussion
    Comments
    Revisions
    Slug
    Author
    Format
    Featured Image
    Categories
    Tags
    Send Trackbacks

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