How to remove my normal blog layout for learndash courses?

Hi I’m using pro and just stared creating learndash content. The problem is it publishes like a blog, which means it has all the stuff I normally have on my blog posts, like footers, “author”, “dates”, etc., as well as a sidebar.

How do I customize my learndash courses so they don’t display all that info? thanks!

Hello @itsbobross,

Thanks for posting in!

To remove your sidebar in your learn dash pages, assuming that the child theme is set up, please add the following code in your child theme’s functions.php file

add_filter('x_option_x_layout_content', 'remove_sidebar_learndash',999);
function remove_sidebar_learndash($layout) {  
    if ( 'product' == get_post_type() || 'sfwd-courses' == get_post_type() || 'sfwd-lessons' == get_post_type() || 'sfwd-quiz' == get_post_type() || 'sfwd-topic' == get_post_type() || 'sfwd-certificates' == get_post_type() )  {      
       $layout = "fullwidth";
   }
  return $layout;
}

To remove the footer, author and other meta, please add the following CSS code in the X > Theme Options > Global CSS (http://prntscr.com/evui3r)

.single-sfwd-courses .p-meta,
.single-sfwd-lessons .p-meta,
.single-sfwd-quiz .p-meta,
.single-sfwd-topic .p-meta,
.single-sfwd-certificates .p-meta,
.single-sfwd-courses .x-colophon,
.single-sfwd-lessons .x-colophon,
.single-sfwd-quiz .x-colophon,
.single-sfwd-topic .x-colophon,
.single-sfwd-certificates .x-colophon {
	dispay: none;
}

We would love to know if this has worked for you. Thank you.

thank you! Results:

  1. I added the code to the child theme’s functions.php and it worked to remove the sidebar. All good.

  2. The footer and other meta did not work. See my code here: https://www.screencast.com/t/7fTwswZfs
    and see the footer still displays: https://highresponsemarketing.com/courses/new-mover/

I also notice that it removed the sidebar but the shortcode I had in the sidebar is still on the page: https://www.screencast.com/t/cW7LzRTDHO

Hello @itsbobross,

Sorry there was a typographic error in the code. Please use this:

.single-sfwd-courses .p-meta,
.single-sfwd-lessons .p-meta,
.single-sfwd-quiz .p-meta,
.single-sfwd-topic .p-meta,
.single-sfwd-certificates .p-meta,
.single-sfwd-courses .x-colophon,
.single-sfwd-lessons .x-colophon,
.single-sfwd-quiz .x-colophon,
.single-sfwd-topic .x-colophon,
.single-sfwd-certificates .x-colophon {
	display: none;
} 

And the PHP code too:

add_filter('x_option_x_layout_content', 'remove_sidebar_learndash',999);
function remove_sidebar_learndash($layout) {  
    if ( 'product' == get_post_type() || 'sfwd-courses' == get_post_type() || 'sfwd-lessons' == get_post_type() || 'sfwd-quiz' == get_post_type() || 'sfwd-topic' == get_post_type() || 'sfwd-certificates' == get_post_type() )  {      
       $layout = "full-width";
   }
  return $layout;
}

We would love to know if this has worked for you. Thank you.

worked! thank you.

You’re welcome!
Thanks for letting us know that it has worked for you.

Thanks for the really fast support. I also need to change the wording here: https://www.screencast.com/t/T6ZwU8Tg86

I can’t seem to find or remember where this setting is in WP or Pro.

Hello @itsbobross,

“The High Response Marketing Blog” is the blog title. You can change this in X > Theme Options > {Your Stack} > Blog Options > Blog Title.

And if you prefer to hide it in all your LearnDash pages, then you will have to update the css code and use this:

.single-sfwd-courses .h-landmark,
.single-sfwd-lessons .h-landmark,
.single-sfwd-quiz .h-landmark,
.single-sfwd-topic .h-landmark,
.single-sfwd-certificates .h-landmark,
.single-sfwd-courses .p-meta,
.single-sfwd-lessons .p-meta,
.single-sfwd-quiz .p-meta,
.single-sfwd-topic .p-meta,
.single-sfwd-certificates .p-meta,
.single-sfwd-courses .x-colophon,
.single-sfwd-lessons .x-colophon,
.single-sfwd-quiz .x-colophon,
.single-sfwd-topic .x-colophon,
.single-sfwd-certificates .x-colophon {
	display: none;
}

Hope this helps. Please let us know how it goes.

worked perfectly thank you so much for all the help

Hi @itsbobross,

We’re glad it worked. Here are some related links for further reading, this could help you in finding and implementing some CSS fixes:

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.