Title: [Theme] Coursepress shortcodes
Last modified: August 22, 2016

---

# [Theme] Coursepress shortcodes

 *  Resolved [sasherwood93](https://wordpress.org/support/users/sasherwood93/)
 * (@sasherwood93)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/theme-coursepress-shortcodes/)
 * Hi all,
 * Can the default Coursepress shortcodes function be overwritten. For Example
 *     ```
       [cp_pages]
       ```
   
 * with the same shortcode but using a custom function. For example
 *     ```
       add_shortcode ( 'cp_pages', 'custom_cpress_pages' );
       ```
   
 * If so how do I do this as I am customising a theme to suit coursepress.
 * _Theme development mention in prior thread [–HERE–](https://wordpress.org/support/topic/theme-coursepress-using-custom-templates?replies=9)_
 * Regards
    Stephen
 * [https://wordpress.org/plugins/coursepress/](https://wordpress.org/plugins/coursepress/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Saurabh – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support7/)
 * (@wpmudev-support7)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/theme-coursepress-shortcodes/#post-5640714)
 * Hi there Stephen,
 * Hope you’re having an awesome day!
 * I just spoke with our developer on this and yes you can 🙂
 * Simply by adding the shortcode in the functions.php of the theme. Like this:
 *     ```
       add_shortcode( 'cp_pages', 'custom_cpress_pages' );function custom_cpress_pages( $atts ) {
           $content = 'some changed content here';
           return $content;
       }
       ```
   
 * Hope that helps Stephen! Let us know if you have any further questions.
 * All the best,
    Tyler
 *  Thread Starter [sasherwood93](https://wordpress.org/support/users/sasherwood93/)
 * (@sasherwood93)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/theme-coursepress-shortcodes/#post-5640715)
 * Hi Tyler,
 * Thanks for your response.
 * This does help thank you. I know the cp_pages shortcode is used in relation to
   the virtual student dashboard etc. Would I be able to use the custom cp_pages
   shortcode to display a custom virtual dashboard instead of your own dashboard,
   just so I can use a custom layout.
 * Many Thanks,
    Stephen
 *  Plugin Support [Saurabh – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support7/)
 * (@wpmudev-support7)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/theme-coursepress-shortcodes/#post-5640748)
 * Hey there Stephen,
 * Apologies for the delay on this one!
 * Yes you can, you can overwrite it like this:
 *     ```
       case 'student_dashboard':
                           require( $plugin_dir . 'includes/templates/student-dashboard.php');
                           break;
       ```
   
 * and in the require put your own own
 * However, after talking to the developer, he suggests the best way would be to
   put a file in your theme called student-dashboard.php that will be used instead
   of the plugin one 🙂
 * Yet another option just for your information is to overwrite “courses_student_dashboard
   shortcode like this:
 *     ```
       add_shortcode( 'courses_student_dashboard', 'my_custom_courses_student_dashboard' );
              function my_custom_courses_student_dashboard( $atts ) {
                   ob_start();
                   require( 'path to your own template here' );
                   $content = ob_get_clean();
                   return $content;
               }
       ```
   
 * Hope this helps Stephen! Let us know if you still need any further assistance.
   Enjoy your weekend 🙂
 * All the best,
    Tyler

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Theme] Coursepress shortcodes’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/coursepress_f7e9b6.svg)
 * [CoursePress Learning Management System](https://wordpress.org/plugins/coursepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/coursepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/coursepress/)
 * [Active Topics](https://wordpress.org/support/plugin/coursepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/coursepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/coursepress/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Saurabh – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support7/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/theme-coursepress-shortcodes/#post-5640748)
 * Status: resolved