Skip to content

Instantly share code, notes, and snippets.

@richstrauss
Last active October 10, 2016 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richstrauss/1cbcc65258fdf9414ce334860c12e0fd to your computer and use it in GitHub Desktop.
Save richstrauss/1cbcc65258fdf9414ce334860c12e0fd to your computer and use it in GitHub Desktop.
LearnDash Breadcrumbs with Uncanny LearnDash Toolkit Plugin and Genesis
<?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