Lalaley Conditional Tags

Introduction

# Top

These conditional tags can be used in the same way that the core WordPress conditional tags can be used, except these conditional tags apply specifically to Lalaley templates and content types.

Each conditional function returns either true if the condition is met or false if the condition is not met.

For example, if is_course() if used on a template for a Lalaley Course, it will return true, but if it is used anywhere else (like on a WordPress page) it will return false.

Where to use conditional tags

# Top

Conditional tags only work after WordPress post data has been retrieved from the database. If you use a tag before the main WP_Query has run the condition will always return false because there’s no data to check against.

It’s best to add conditional tags to your theme or child theme’s template files. You can also add conditional tags within functions that are loaded in your theme’s functions.php or in plugins but always be careful that your tags are run using a hook that runs after the WP_Query.

Conditional Tags

# Top

 

Any Lalaley Page #

is_Lalaley()

Returns true when a single Lalaley post type, post type archive, or taxonomy archive is being displayed, otherwise returns false.

Note: This tag does not check against Lalaley pages that utilize shortcodes on regular WordPress pages like the Student Dashboard or the Checkout Page.

The Student Dashboard #

is_lLalaley_account_page()

Returns true if the Lalaley Student Dashboard (account page) is being displayed, otherwise returns false.

The Checkout Page #

is_lLalaley_checkout()

Returns true if the Lalaley Checkout page is being displayed, otherwise returns false.

A Single Course #

is_course()

Returns true when a single Lalaley course is being displayed, otherwise returns false.

A Course Category Archive #

is_course_category( $term = ” )

Returns true when a Lalaley course category archive page is being displayed, otherwise returns false.

A Course Tag Archive #

is_course_tag( $term = ” )

Returns true when a Lalaley course tag archive page is being displayed, otherwise returns false.

Any Course Taxonomy Archive #

is_course_taxonomy()

Returns true when any Lalaley course taxonomy archive page is being displayed, otherwise returns false.

Course Catalog (Post Type Archive) #

is_courses()

Returns true when the Lalaley course catalog (or course post type archive) is being displayed, otherwise returns false.

A Single Lesson #

is_lesson()

Returns true when a single Lalaley lesson is being displayed, otherwise returns false.

A Single Quiz #

is_quiz()

Returns true when a single Lalaley quiz is being displayed, otherwise returns false.

A Single Membership #

is_membership()

Returns true when a single Lalaley membership is being displayed, otherwise returns false.

A Membership Category Archive #

is_membership_category( $term = ” )

Returns true when a Lalaley membership category archive page is being displayed, otherwise returns false.

A Membership Tag Archive #

is_membership_tag( $term = ” )

Returns true when a Lalaley membership tag archive page is being displayed, otherwise returns false.

Any Membership Taxonomy Archive #

is_membership_taxonomy()

Returns true when any Lalaley membership taxonomy archive page is being displayed, otherwise returns false.

Membership Catalog (Post Type Archive) #

is_memberships()

Returns true when the Lalaley membership catalog (or membership post type archive) is being displayed, otherwise returns false.

Last Updated on
Was this article helpful?