WordPress.org

Ready to get started?Download WordPress

Forums

Print Friendly and PDF Button
[resolved] Print Friendly appearing twice (8 posts)

  1. goldenshiva
    Member
    Posted 1 year ago #

    Hi there,

    On my post pages, Print Friendly is showing at the bottom of each post (where it should), but then again in the bottom of the footer.

    Print Friendly doesnt appear at all on static pages (which is perfect obviously) nor the footer.

    Any ideas how can I get rid of the second link in the post-page footer? Is there some code I can use to deactivate this?

    Example here:

    http://www.feedyourawesomemachine.com/creamy-butternut-squash-soup-with-ginger-coconut-milk-red-lentils/

    Really appreciate your help!

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

  2. jrf
    Member
    Plugin Contributor

    Posted 1 year ago #

    Hiya,

    Looks like your theme uses a page as the footer. If that's true, you could try adding something along the lines of the below to your theme's functions.php file (preferably of course to a child theme's functions.php file so you won't lose this when the theme upgrades).
    Whether this will work depends on how your theme loads the footer page (I've presumed using wp_footer, but they may use get_sidebar or an theme specific hook). Check with the theme author and/or have a look at the theme documentation.

    add_action( 'wp_footer', 'remove_pf_from_footer', 1 );
    function remove_pf_from_footer() {
      if( $page_id === # ) { //replace # with the page number of the page you use as a footer
        remove_filter( 'the_content', array( $printfriendly, 'show_link' ) );
      }
    }

    Hope this helps !

    Smile,
    Juliette

  3. aisajib
    Member
    Posted 1 year ago #

    Hi,

    Did you try checking only "Posts" from PrintFriendly & PDF settings page? Please try that and see if that removes the second button. If that happens, then the second post in this thread could be the solution.

  4. goldenshiva
    Member
    Posted 1 year ago #

    Hi aisajib & Julie,

    The first thing I did was check all the settings and it is set to show on posts only.

    I've tried asking on the themes forum but I haven't had much luck. Julie I'd rather not touch the php files if possible- although I'm fairly comfortable with HTML & CSS at this stage, php is still complete double Dutch! But I will try if I cant find any other solution...

  5. jrf
    Member
    Plugin Contributor

    Posted 1 year ago #

    Hiya,

    Ok, I had a look at the page source this time. It's not a page, but a post which is used as the footer - post 582 to be exact -.
    You are using a Headway theme. As it's a paid theme, I can't check whether they have a setting you could set for this. You should really go to their proprietary forum and ask them how you can disable certain plugin content filters for the footer.

    In the mean time, knowing that you are uncomfortable with editing PHP, try adding this to your CSS file:

    #post-582 .printfriendly {
      display: none;
    }

    You may need to fiddle a bit with the specificity to make sure the rule gets picked up.

    Hope this helps.

    Smile,
    Juliette

  6. goldenshiva
    Member
    Posted 1 year ago #

    jrf, thanks for that. I was so caught up in the notion that it was a page that I had used for the footer and NOT a post, that I had totally neglected to try the obvious! I used some code similar to what you suggested & it worked.

    Thanks for your help!

  7. aisajib
    Member
    Posted 1 year ago #

    I'm glad it worked, goldenshiva!

  8. jrf
    Member
    Plugin Contributor

    Posted 1 year ago #

    You're very welcome ;-

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic