Skip to main content

Course

For loop type learndash_course, here are the query parameters and fields.

Query parameters

  • access_type - Access type: Open(open), Free(free), Buy now(paynow), Recurring(subscribe), Closed(closed)
    Type: string, array

  • author - Include by author ID, login name, or 'current'
    Type: string, array

  • category - Include by category ID, slug, or 'current'
    Type: string, array

  • certificate_earned - Course Certificate earned or not
    Type: boolean

  • certificate_exists - Course Certificate exists or not
    Type: boolean

  • child_terms - Set 'true' to include child terms for hierarchical taxonomies
    Type: string

  • completion_status - Course Completion Status for the User: Not Started(open), In Progress(started), Completed(completed)
    Type: string, array

  • course - Course ID or 'current' for current course
    Type: string

  • custom_date_field - Filter by given custom date field - Faster than using 'field', this queries raw field values in the database
    Type: string

  • custom_date_field_compare - Compare using one of: 'equal' (default), 'not', 'before', 'before_inclusive', 'after', 'after_inclusive'
    Type: string

  • custom_date_field_format - For custom date field query, specify the date format of the field value - Default is 'Ymd'; For date-time field, set 'Y-m-d H:i:s'. If it's a timestamp, use 'timestamp'. For custom field plugins other than ACF, you may need to use a different format.
    Type: string

  • custom_date_field_type - For custom date field query, one of: date (default), time, datetime, number
    Type: string

  • custom_date_field_value - Filter by given custom date field value, or 'current'
    Type: string

  • custom_field - Filter by given custom field - Faster than using 'field', this queries raw field values in the database
    Type: string

  • custom_field_2 - See attribute 'custom_field'
    Type: string

  • custom_field_3 - See attribute 'custom_field'
    Type: string

  • custom_field_compare - Compare using one of: 'equal' (default), 'not', 'before', 'before_inclusive', 'after', 'after_inclusive'
    Type: string

  • custom_field_compare_2 - See attribute 'custom_field_compare'
    Type: string

  • custom_field_compare_3 - See attribute 'custom_field_compare'
    Type: string

  • custom_field_type - For custom field query, one of: string (default), number, date, time, datetime
    Type: string

  • custom_field_type_2 - See attribute 'custom_field_type'
    Type: string

  • custom_field_type_3 - See attribute 'custom_field_type'
    Type: string

  • custom_field_value - Filter by given custom field value
    Type: string

  • custom_field_value_2 - See attribute 'custom_field_value'
    Type: string

  • custom_field_value_3 - See attribute 'custom_field_value'
    Type: string

  • enrolled - Current user is enrolled
    Type: boolean

  • exclude - Exclude by ID or name
    Type: string, array

  • exclude_author - Exclude by author ID, login name, or 'current'
    Type: string, array

  • exclude_category - Exclude by category ID, slug, or 'current'
    Type: string, array

  • exclude_parent - Exclude by parent ID or name
    Type: string, array

  • exclude_tag - Exclude by tag ID, slug, or 'current'
    Type: string, array

  • group_leader - Group Leader ID the Course belongs to
    Type: string

  • id - ID
    Type: string, array

  • ignore_sticky_posts - Ignore sticky posts
    Type: boolean - Default: TRUE

  • include - Include by ID or name
    Type: string, array

  • include_children - Include children
    Type: boolean

  • linked_group - Group ID the Course belongs to
    Type: string, array

  • name - Name/slug
    Type: string, array

  • order - Order: asc (ascending) or desc (descending)
    Type: string - Default: asc

  • order_by_field - Custom order by field
    Type: string

  • orderby - Order by one of: id, author, title, name, type, date, modified, random, comment_count, relevance, menu
    Type: string - Default: title

  • orderby_field - Order by custom field
    Type: string

  • orderby_field_number - Order by custom field whose value is a number
    Type: string

  • page - Page number
    Type: number - Default: 1

  • paged - Posts per page
    Type: number - Default: -1

  • parent - Include by parent ID or name
    Type: string, array

  • prerequisite_completed - Course Prerequisite completed or not
    Type: boolean

  • prerequisite_exists - Course Prerequisite exists or not
    Type: boolean

  • publish_compare - Publish date comparison - One of: 'before', 'before_inclusive', 'after', 'after_inclusive'
    Type: string

  • publish_date - Filter by publish date in Y-M-D format, 'today', 'X days ago' and other values compatible with strtotime() - Optionally use 'publish_compare' attribute
    Type: string

  • publish_day - Filter by given publish day of the month, from 1 to 31, or 'current'
    Type: number

  • publish_month - Filter by given publish month, from 1 to 12, or 'current'
    Type: number

  • publish_week - Filter by given publish week, from 1 to 54, or 'current' - Note: the 'publish_compare' attribute is not supported for this field
    Type: number

  • publish_year - Filter by given publish year, or 'current'
    Type: number

  • search - Search by given keyword - Prepending a keyword with a hyphen '-' will exclude posts matching it
    Type: string

  • status - Post status: publish (default), pending, draft, future, private, trash
    Type: string, array - Default: publish

  • tag - Include by tag ID, slug, or 'current'
    Type: string, array

  • taxonomy - Include by taxonomy ID, slug, or 'current' for taxonomy archive. Use with 'term' and 'taxonomy_compare' attributes
    Type: string, number

  • taxonomy_2 - See attribute 'taxonomy'
    Type: string, number

  • taxonomy_3 - See attribute 'taxonomy'
    Type: string, number

  • taxonomy_compare - One of 'in' (default), 'not', 'and', 'exists', and 'not exists'.Use with 'taxonomy' attribute
    Type: string

  • taxonomy_compare_2 - See attribute 'taxonomy_compare'
    Type: string

  • taxonomy_compare_3 - See attribute 'taxonomy_compare'
    Type: string

  • taxonomy_relation - When using more than one 'taxonomy' queries, can specify 'and' or 'or'
    Type: string, string

  • terms - Include by taxonomy term ID, slug, or 'current'.Use with 'taxonomy' attribute
    Type: string, number, array

  • terms_2 - See attribute 'terms'
    Type: string, number, array

  • terms_3 - See attribute 'terms'
    Type: string, number, array

  • type - Post type(s)
    Type: string, number, array - Default: post

  • video_exists - Lesson video exists, true or false
    Type: boolean

Fields

  • all - Show all custom fields (for development purpose)

  • ancestors - Ancestor posts from lowest to highest level; Set reverse=true to go from top-level down

  • archive_author - On an author archive page: Current author as a user loop

  • archive_post_type - On a post type archive page: Current post type as a loop

  • archive_term - On a taxonomy archive page: Current taxonomy term as a loop

  • author - Author

  • author_* - Author's user field

  • children - Children

  • children_ids - Children IDs

  • content - Content

  • course_access_expires - When a user will have access to the course.

  • course_certificate_data - Course certificate data loop.

  • course_certificate_id - Course certificate ID.

  • course_certificate_link - Course certificate link.

  • course_certificate_url - Course certificate URL.

  • course_content_table - Displays the Course Content table (lessons, topics, and quizzes)

  • course_content_table_ld - Displays the Course Content table - LearnDash template (lessons, topics, and quizzes)

  • course_date_completed - Course date completed

  • course_enroll - Take this course button

  • course_enrolled - Course is enrolled by current user

  • course_groups - List of Course groups

  • course_last_activity - Last User Activity

  • course_lessons - List of Course Lessons

  • course_lessons_number - Number of Course Lessons.

  • course_materials - Course materials.

  • course_next_step_id - Course next step Id

  • course_next_step_title - Course next step title

  • course_next_step_url - Course next step URL

  • course_points - Number of points awarded for completing the course.

  • course_points_access - Number of points required in order to gain access to the course.

  • course_price - Price

  • course_price_currency - Price Currency

  • course_price_type - Price type

  • course_price_type_label - Price type label

  • course_price_url - Price URL - Only for closed courses

  • course_progress - Displays the Course Progress bar

  • course_progress_percent - Course progress percent

  • course_quizzes - List of Course quizzes(final quizzes)

  • course_quizzes_all - List of all Course, Lessons and Topics quizzes

  • course_quizzes_number - Number of Course Quizzes.

  • course_resume_id - Course Resume - first incomplete step id

  • course_resume_title - Course Resume - first incomplete step title

  • course_resume_url - Course Resume - first incomplete step url

  • course_since - From when the Course is available.

  • course_status - Course status ('Not Started', 'In Progress', 'Completed' converted to 'open', 'started', 'completed')

  • course_status_label - Course status label ('Not Started', 'In Progress', 'Completed' )

  • course_steps_completed - Course steps completed

  • course_steps_total - Course steps total

  • course_students_number - Number of Course Students.

  • course_topics - List of all Course Lessons Topics

  • course_topics_number - Number of Course Topics.

  • edit_url - Edit URL

  • excerpt - Excerpt

  • id - ID

  • image - Featured image

  • image_* - Featured image field

  • menu_order - Menu order

  • modify_date - Modify date

  • name - name/slug

  • parent - Parent

  • parent_* - Parent field

  • parent_* - Parent field

  • parent_ids - All parent IDs from current to top

  • post_class - Post classes

  • publish_date - Publish date

  • status - Status

  • title - Title

  • url - URL