Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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!

    #333197

    Hey 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, 2 months ago by Arvish.
    #333327

    Thank 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.

    #333478

    Hi!

    You can copy the whole modified avia_social_share_links class (129-244) to your child theme functions.php

    Cheers!
    Josue

    #334065

    Thank 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.

    #334082

    Hi!

    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,
    Josue

    #334090

    Thank 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.

    #334108

    Hi!

    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

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.