• Resolved Gabe462

    (@gabe462)


    Hello, I’m trying to figure out what it will take to get this working. I want to pin the post content, so I’m using the shortcode form and trying to stick get_the_content() into the description=”” field.

    Unfortunately I’m still getting the post title as the pin content, and the post content is appearing below the pinit button. Any ideas?

    function add_pinterest_via_shortcode( $content ) {
    	$pin_content = strip_tags( get_the_content() );
    	$content .=  do_shortcode("[pinit description=' $pin_content']");
    
    	return $content;
    }
    add_filter( 'the_content', 'add_pinterest_via_shortcode');

    https://www.ads-software.com/extend/plugins/pinterest-pin-it-button/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘use post content in pinit shortcode description field’ is closed to new replies.