Pinterest "Pin It" Button
[resolved] use post content in pinit shortcode description field (4 posts)

  1. Gabe462
    Posted 2 years ago #

    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');


  2. Gabe462
    Posted 2 years ago #

    I realized that trying to use a description that contains quotes, escaped or not, reverts the plugin back to using the title. Any idea why?

  3. Gabe462
    Posted 2 years ago #

  4. Phil Derksen
    Plugin Author

    Posted 2 years ago #

    Glad you found it!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Pinterest "Pin It" Button
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic