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

john hennelly
PLUS
john hennelly
Courses Plus Student 2,831 Points

Is there a typo on Vid 3 of How to build a WP Plugin or am I just not getting it?

In the code below - Should not the

$content.=$new_content; 

be

$content.=$social_content; 
/* create our own function and pass in the content object */

    function make_content_social ($content) {

/*    b. makes sure that it is only seen on a single page and inside of the main loop  */ 

    if( is_singular () && is_main_query ()) {
        $social_content = ‘Insert in the social sharing code here’; 
        $content.=$new_content; 

}
    return $content; 
}

add_filter( ‘the_content’, ‘make_content_social’);  

1 Answer

john hennelly
PLUS
john hennelly
Courses Plus Student 2,831 Points

I tested a similar function on mamp and it worked with the variable setup that i mentioned - - so I am assuming that it was a misprint in the program.