Use pop Up instead of blank page
-
Hello,
is it possible to use a Pop up instead of a blank or the same page.
-
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.
Thanks!
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 facebook.com till you find this code$htmlShareButtons .= '<a id="ssba_facebook_share" href="http://www.facebook.com/sharer.php?u=' . $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("http://www.facebook.com/sharer.php?u=' . $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.
Thanks!
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) {
window.open(URL, ‘Windowname’, ‘width=450, height=300, toolbar=0, scrollbars=1 ,location=0 ,statusbar=0,menubar=0, resizable=0’);
}
//–>
</script>Awesome! You made my life so much better! Thanks!
Is there anything special in the pinterest share link?Hey,
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("http://pinterest.com/pin/create/button/?url='. $urlCurrentPage . '&media='.wp_get_attachment_url(get_post_thumbnail_id()).'&description='.get_the_title().'")\'>';
with this code you can only post one fixed picture.
Enjoy!
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.phpI 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(); ?>" /> </a> <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.
regards
- The topic ‘Use pop Up instead of blank page’ is closed to new replies.