Support » Plugin: WP Print Friendly » How can I block a function that shouldn’t be called into my site, but is?

  • Resolved sleeplessinDC

    (@sleeplessindc)


    At first I thought this was a theme problem, then I thought it was a Fix WordPress problem, but after searching for where the function comes from, I found out that it is an interference from the Print Friendly plugin.

    I am having a very strange problem with getting the first image at the top of my Home page to behave the same as all the other images. I’ve tried several different ways using CSS and HTML divs to get it to stay the full size, be centered, with the caption under it. I looked at the source and discovered that a WooCommerce function is getting called in for displaying this first image and I am not using WooCommerce. The first image is being put inside <div class=”pf-content”>. How do I block this from happening? It is really messing up the top of my Home page.

    The following is how I have it coded in the Home page. It keeps getting reduced from 900 px to 500 px wide. I’ve tried using a 1000px image, even a 2000px image and they all get shrunken to 500 px and offset to the right of center with the caption offset flush left.

    [caption id="attachment_1168" align="aligncenter" width="900"]<a href="http://dev.baeecorp.org/wp-content/uploads/reception_panorama-900x219.png"><img src="http://dev.baeecorp.org/wp-content/uploads/reception_panorama-900x219.png" alt="Photo of the opening exhibition at the U.S. Botanic Garden" width="900" height="219" class="size-full wp-image-1168" style="border:5px double #ccd; border-radius:10px; text-align:center;" /></a> Panorama of the opening reception, February 2014, at the U.S. Botanic Garden for the BAEE Exhibition.<br />Photo credit: Dennis Chesters.[/caption]

    I have even tried putting a controlling div around it (<div style="float:center; width:100%; text-align:center;">). That helps to get it centered with caption centered underneath but the image still gets shrunken because it is put inside the WooCommerce funtion pf-content. I searched the WordPress installation and found a file called pf.php in the Print Friendly plugin but that doesn’t make any sense to me that this is needed for friendly printing. Here is the function that I think is the culpret:

      /**
       * Add pf-content class to WooCommerce main Product Image
       *
       * @since 3.5
       */
      function woocommerce_single_product_image_html( $image ) {
        if ( $this->is_content_algo_on($image) ) {
          return $this->add_class($image, 'pf-content');
        } else {
          return $image;
        }
      }
    
      /**
       * Add pf-content class to WooCommerce Product Images from gallery
       *
       * @since 3.5
       */
      function woocommerce_single_product_image_thumbnail_html( $image ) {
        return $this->add_class($image, 'pf-content pf-gallery-img', 'img');
      }

    How can I protect my image so this unwanted function doesn’t come in? The code leading up to the image is

    		</header><!-- .entry-header -->
    			<div class="entry-content">
    				<div class="pf-content">[caption id="attachment_1168" align="aligncenter" width="900"]<a

    Is there a way to add a function in my child theme’s function.php file that blocks that pf-content div?

    Thanks for your help.

Viewing 1 replies (of 1 total)
  • Thread Starter sleeplessinDC

    (@sleeplessindc)

    Ignore this as this question was posted to the wrong plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘How can I block a function that shouldn’t be called into my site, but is?’ is closed to new replies.