Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can install this yourself. Here’s how:

    Add this code to your header.php

    <script type="text/javascript">
    	//initialize the 3 popup css class names - create more if needed
    	var matchClass=['popup1','popup2','popup3'];
    	//Set your 3 basic sizes and other options for the class names above - create more if needed
    	var popup1 = 'width=600,height=270,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=20,top=20';
    	var popup2 = 'width=600,height=400,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=20,top=20';
    	var popup3 = 'width=600,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=20,top=20';
    
    	//The pop-up function
    	function tfpop(){
    			var x = 0;
    			var popClass;
    			//Cycle through the class names
    			while(x < matchClass.length){
    					popClass = "'."+matchClass[x]+"'";
    					//Attach the clicks to the popup classes
    					jQuery(eval(popClass)).click(function() {
    							//Get the destination URL and the class popup specs
    							var popurl = jQuery(this).attr('href');
    							var popupSpecs = jQuery(this).attr('class');
    							//Create a "unique" name for the window using a random number
    							var popupName = Math.floor(Math.random()*10000001);
    							//Opens the pop-up window according to the specified specs
    							newwindow=window.open(popurl,popupName,eval(popupSpecs));
    							return false;
    					});
    			x++;
    			}
    	}
    
    	//Wait until the page loads to call the function
    	jQuery(function() {
    		tfpop();
    	});
    </script>

    Note, you might want to change the jQuery variable to whatever you use. I usually use jQuery as that works better for a no conflict.

    Now you can go into the simple-share-buttons-adder.php to add the different classes. I used popup1 for twitter, popup 2 for facebook, and popup3 for linkedin. You can adjust the sizing as needed.

    Just go to where they call the different share link $htmlShareButtons and add class="popup1"

    For example, it should look like this for the twitter share

    $htmlShareButtons .= '<a id="ssba_twitter_share" class="popup1" href="http://twitter.com/share?url=' . $urlCurrentPage . '&text=' . $twitterShareText . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? 'target="_blank"' : NULL) . '>';

    You can see how I added class="popup1" to the a href code. Do that for each share button that you want a popup for.

    Around Line 650 in simple-share-buttons-adder.php

    You’re going to want to comment out these lines (add // before) under // get page name and url from functions:

    $urlCurrentPage = ssba_current_url();
    $strPageTitle = $_SERVER[“SERVER_NAME”];

    and replace that with

    $urlCurrentPage = get_permalink($post->ID);
    $strPageTitle = get_the_title($post->ID);

    Hi Buddy,

    This is because the new version allows different layouts. Kind of irritating that they don’t mention it but it should be in you theme options settings. I’m not sure what theme you are using and I’m too lazy to google it but underneath your theme options > woocommerce settings it should have the column settings. This is different than your main theme layout settings so that’s why it can be confusing. If this helped you, buy me a beer.

Viewing 3 replies - 1 through 3 (of 3 total)