Support » Plugin: Simple Share Buttons Adder » Use pop Up instead of blank page

Viewing 15 replies - 1 through 15 (of 26 total)
  • Hello,

    I would like to add the same question. It is quite inconvenient to have the social networks open in a new window because people will most probably never come back to the site. It would be great if you provide us with the required code.


    P.S. Awesome plugin!

    Hello i found a solution. maybe you will implement it in the plugin.

    i will give an example for facebook. so anybody cann use this to create pop up’s for the other share buttons.

    1: go to plugins/editor
    2: choose Simple Share buttons Adder
    3: select simple-share-buttons-adder.php
    4: search for till you find this code

    $htmlShareButtons .= '<a id="ssba_facebook_share" href="' . $urlCurrentPage . '" ' . //($arrSettings['ssba_share_new_window'] == 'Y' ? 'target="_blank"' : NULL) . '>';

    5: replace it with the folowing code

    $htmlShareButtons .= '<a id="ssba_facebook_share" href=\'javascript:PopUp("' . $urlCurrentPage . '")\'>';

    6: enjoy!

    Hey shyne23,

    thank you for your feedback! I added the code as you said but it didn’t work. I have no idea about php so I might be missing something.


    Hey Siskoto,

    sorry i miss one point.

    you have to add the following code to your header.php (before head)

    <script language=”JavaScript”>
    function PopUp(URL) {, ‘Windowname’, ‘width=450, height=300, toolbar=0, scrollbars=1 ,location=0 ,statusbar=0,menubar=0, resizable=0’);

    Awesome! You made my life so much better! Thanks!
    Is there anything special in the pinterest share link?


    Pinterest already use a iframe. It looks like a new page, but its a Javascrip, you can select the image to pin. After selecting a picture anoter popup will appear and the other window will dissapear.

    I look for a solution. Maybe you like this one more!

    $htmlShareButtons .= '<a id="ssba_pinterest_share" href=\'javascript:PopUp("'. $urlCurrentPage . '&media='.wp_get_attachment_url(get_post_thumbnail_id()).'&description='.get_the_title().'")\'>';

    with this code you can only post one fixed picture.


    Well, this one did not actually work. I will stick with the standard option given in the plugin. Thanks again for all your help!

    Did you replace the original code with the new one ?

    yes, I did but it opened the pinterest sharing page and nothing in it. You can see it here:

    Okay, you didnt get the attachment_url. Please look if there ist a wp_get_attachment_url function in your post.php

    I don’t have post.php file but page.php and here is the code:

    <?php get_header(); ?>
    		<?php get_template_part( 'element', 'getslider' ); ?>
    		<?php get_template_part( 'element', 'pagecaption' ); ?>
    			<!-- THE POST LOOP -->
    			<?php while ( have_posts() ) : the_post(); ?>	
    				<?php if(get_custom_field('hide_title') == 'Yes') : else : ?>
    				<h2 class="title"><span><?php the_title(); ?></span></h2>
    				<hr />
    				<?php endif; ?>
    				<!-- FEATURED IMAGE (optional) -->
    				<?php if(get_option_tree('show_featured_image') == 'Yes') : ?>
    						<?php if (has_post_thumbnail( $post->ID )) 	{
    						$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>
    						<a class="featured-image-insert" href="<?php echo $image[0]; ?>" data-rel="prettyPhoto">
    							<img class="aligncenter" src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" />
    					<br class="clearfix" />
    					<?php } else {} ?>
    				<?php endif; ?>
    				<?php the_content(); ?>
    				<br class="clearfix" />
    				<!--<hr />-->
    				<?php wp_link_pages('before=<br /><div id="page-links"><span>Pages:</span>&after=</div><hr />&link_before=<div>&link_after=</div>'); ?>
    			<?php endwhile; ?>			
    <?php get_footer(); ?>


    sorry about that

    I found the problem. My code doesn’t work with the nextgen gallery because it looks for attached images of a post. i am sorry but you have to use the default function of the ssba plugin.


Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘Use pop Up instead of blank page’ is closed to new replies.