-
AuthorPosts
-
October 8, 2014 at 6:53 am #332140
hey guys, thank you for such a great theme!
I’m loving it. Something I noticed that felt a little odd is that the “Share on social media icons” at the bottom of blog post pages open in a new window. In many cases this is okay but in the particular case of facebook, the landing page for posting into facebook seems to be formatted best for a small popup window and not a full page tab / window.
Is there any option to open those share links on small popups or overlays so that they look a bit more elegant?
Thanks!
October 9, 2014 at 1:40 pm #333197Hey momon!
Replace this line in helper-social-media.php in your enfold/includes/admin folder:
$blank = strpos($share['url'], 'mailto') !== false ? "" : "target='_blank'";
With:
$new_window = "onclick=\"window.open(this.href, 'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;\""; $blank = strpos($share['url'], 'mailto') !== false ? "" : $new_window;
Best regards,
Arvish- This reply was modified 10 years, 1 month ago by Arvish.
October 9, 2014 at 4:38 pm #333327Thank you.
I’m not a fan of modifying source files as they will break on upgrade so I always try to make changes on a child theme.
Is there any way this modification can be integrated in the child theme?
Thanks.
October 9, 2014 at 11:16 pm #333478Hi!
You can copy the whole modified avia_social_share_links class (129-244) to your child theme functions.php
Cheers!
JosueOctober 10, 2014 at 8:17 pm #334065Thank you, that’s exactly what I wanted. Is there any way to load the popup in the middle of the screen? right now it is launching very oddly at the top left corner.
Thanks.
October 10, 2014 at 9:22 pm #334082Hi!
Try adjusting the left/top values here:
$new_window = "onclick=\"window.open(this.href, 'mywin','left=100,top=100,width=500,height=500,toolbar=1,resizable=0'); return false;\"";
Best regards,
JosueOctober 10, 2014 at 10:02 pm #334090Thank you for the reply.
Adjusting those values would be okay for my screen specifically or a fixed size. I was hoping for something that would dynamically calculate the current screen size via javascript and define the left and top values then so that it would always center.
Thanks.
October 10, 2014 at 11:21 pm #334108Hi!
That’s possible, unfortunately that falls beyond the support scope we can offer, you’d need to implement something like this – http://stackoverflow.com/questions/4068373/center-a-popup-window-on-screen
Cheers!
Josue -
AuthorPosts
- You must be logged in to reply to this topic.