Last active
October 10, 2016 13:32
-
-
Save richstrauss/1cbcc65258fdf9414ce334860c12e0fd to your computer and use it in GitHub Desktop.
LearnDash Breadcrumbs with Uncanny LearnDash Toolkit Plugin and Genesis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// LearnDash Breadcrumbs with Uncanny LearnDash Toolkit Plugin and Genesis | |
// https://wordpress.org/plugins/uncanny-learndash-toolkit/ | |
// Code goes into functions.php | |
add_action( 'genesis_before', 'wpe_remove_genesis_breadcrumbs_courses' ); | |
function wpe_remove_genesis_breadcrumbs_courses() { | |
if ('sfwd-courses' == get_post_type()) {//add in your CPT name | |
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); | |
} | |
} | |
add_action( 'genesis_before_loop', 'wpe_learndash_breadcrumbs_courses' ); | |
function wpe_learndash_breadcrumbs_courses() { | |
if ('sfwd-courses' == get_post_type()) {//add in your CPT name | |
echo do_shortcode('[uo_breadcrumbs]'); | |
} | |
} | |
add_action( 'genesis_before', 'wpe_remove_genesis_breadcrumbs_lesson' ); | |
function wpe_remove_genesis_breadcrumbs_lesson() { | |
if ('sfwd-lessons' == get_post_type()) {//add in your CPT name | |
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); | |
} | |
} | |
add_action( 'genesis_before_loop', 'wpe_learndash_breadcrumbs_lesson' ); | |
function wpe_learndash_breadcrumbs_lesson() { | |
if ('sfwd-lessons' == get_post_type()) {//add in your CPT name | |
echo do_shortcode('[uo_breadcrumbs]'); | |
} | |
} | |
add_action( 'genesis_before', 'wpe_remove_genesis_breadcrumbs_topic' ); | |
function wpe_remove_genesis_breadcrumbs_topic() { | |
if ('sfwd-topic' == get_post_type()) {//add in your CPT name | |
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); | |
} | |
} | |
add_action( 'genesis_before_loop', 'wpe_learndash_breadcrumbs_topic' ); | |
function wpe_learndash_breadcrumbs_topic() { | |
if ('sfwd-topic' == get_post_type()) {//add in your CPT name | |
echo do_shortcode('[uo_breadcrumbs]'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment