WordPress.org

Ready to get started?Download WordPress

Forums

Print Friendly and PDF Button
[resolved] shortcode (7 posts)

  1. Drain0
    Member
    Posted 2 years ago #

    Is it possible to have the buttons display on only one chosen page/post? (via shortcode)

    http://wordpress.org/extend/plugins/printfriendly/

  2. jrf
    Member
    Plugin Contributor

    Posted 2 years ago #

    Of course, just add the following code to your theme's functions.php file:

    /**
     * Shortcode for printfriendly buttons
     */
    add_shortcode('pf_button', 'get_printfriendly_button');
    function get_printfriendly_button() {
    	if( function_exists('pf_show_link') ){
    		return pf_show_link();
    	}
    }

    Hope this helps!

    Smile,
    Juliette

  3. Drain0
    Member
    Posted 2 years ago #

    Excellent, thanks Juliette. Just one thing - what is the shortcode?

  4. jrf
    Member
    Plugin Contributor

    Posted 2 years ago #

    The first argument in the add_shortcode line, i.e.: 'pf_button'

  5. jrf
    Member
    Plugin Contributor

    Posted 2 years ago #

    FYI: the second argument is the name of the function to call, i.e. the function we created.

  6. Drain0
    Member
    Posted 2 years ago #

    Thank you very kind

  7. printfriendly
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for helping out @JRF :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags