Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress How to Build a WordPress Plugin Building WordPress Widgets, and Shortcodes How to Create a WordPress Shortcode

Phillip Legault
PLUS
Phillip Legault
Courses Plus Student 18,888 Points

Short Code producing errors

I have been getting error after adding the short code.

Notice: Undefined variable: before_widget in C:\xampp\htdocs\wordpress\wp-content\plugins\wptreehouse-badges\inc\front-end.php on line 3

Notice: Undefined variable: title in C:\xampp\htdocs\wordpress\wp-content\plugins\wptreehouse-badges\inc\front-end.php on line 4

Notice: Undefined variable: before_title in C:\xampp\htdocs\wordpress\wp-content\plugins\wptreehouse-badges\inc\front-end.php on line 4

Notice: Undefined variable: after_title in C:\xampp\htdocs\wordpress\wp-content\plugins\wptreehouse-badges\inc\front-end.php on line 4

So I took the code from the download and replaced mine and I still get the same error.

I was getting a similar error on the back end code and had to update is with

        if(isset($title)) {
        require( 'inc/front-end.php' );
    }