Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #1151784

    Hi Guys,
    to get a lightbox pop up, I installed a “php inserter” plugin (my custom functions) and inserted this code:

    function inline_popup_enabler(){
    ?>
    <script>
    (function($){
    $(window).load(function() {
    $(‘.inline_popup’).magnificPopup({
    type:’inline’,
    midClick: true
    });
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘inline_popup_enabler’);

    and finally saved it.
    After that I created a link with this class: “inline_popup” and a color section with a css-class called “mfp-hide”.
    Unfortunately without the expected result. After clicking on the link, I get no reaction.

    Can you recognize, what I did wrong?

    Best regards
    Grobi

    #1152006

    Hey Grobi,

    Thank you for the inquiry.

    You have to apply a unique ID to the color section and use it as the value of the href attribute in the link or button. You will then use the script above to initialize the lightbox for the popup link. A more detailed explanation on how to enable an inline popup can be found in its documentation. Please check the link below.

    // https://dimsemenov.com/plugins/magnific-popup/documentation.html#inline-type

    Best regards,
    Ismael

    #1152449

    Hi Ismael,
    thanks for your informations.
    I will work this through und keep you informed.
    Best regards.
    Grobi

    #1152733

    Hi Grobi,

    Glad we could help :)

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1152747

    Hi Ismael and Victoria.
    I have not made any progress … unfortunately.
    I studied the link that Ismael gave me and I saw that it is the same principal I used before. So I could not solve the issue.

    I know, the biggest problem with computers mostly sit in front the monitor (and perhaps it will be exactly that at the end). But I think I was going the correct way to build that lightbox pop up.
    Is it possible, that you have a closer look on my site? That would be very kind.

    Best regards
    Grobi

    #1152968

    Hi,

    Thank you for following up.

    Did you remove the page with the “demopopup”? It doesn’t seem to exist anymore — leads to a 404 page. Please post the login details in the private field so that we can create a test page with an inline popup, or follow these steps.

    1.) Add the above snippet in the functions.php file to initialize the lightbox.

    2.) Create a link with the “inline_popup” class name and set the href attribute to the ID of the element that you want to display inside the lightbox.

    <a href="#inline-section" class="inline_popup">Inline Popup</a>
    

    3.) Edit the color section element, then use “inline-section” in the Section ID field. Update the page.

    Best regards,
    Ismael

    #1153063

    Hi Ismael, at first: I am very sorry, during searching any mistake I’ve made, I created a new test-page and renamed it. I apology, I did not want to boycott the efforts you make! The page’s name is: https://einklang-heilpraxis.de/popuptestpage/. And here the credentials for admin-access:

    Thanks for giving me help!
    Best regards
    Grobi

    #1154270

    Hi Ismael,
    I just tried again – with fresh eyes – and followed your hints.
    I put the above snippet in the functions.php and got this warning:

    Warning: Use of undefined constant ‘wp_footer’ – assumed ‘‘wp_footer’’ (this will throw an Error in a future version of PHP) in /homepages/10/d788490951/htdocs/cms/wp-content/themes/enfold/functions.php on line 67

    Warning: Use of undefined constant ‘inline_popup_enabler’ – assumed ‘‘inline_popup_enabler’’ (this will throw an Error in a future version of PHP) in /homepages/10/d788490951/htdocs/cms/wp-content/themes/enfold/functions.php on line 67

    Warning: Cannot modify header information – headers already sent by (output started at /homepages/10/d788490951/htdocs/cms/wp-content/themes/enfold/functions.php:67) in /homepages/10/d788490951/htdocs/cms/wp-admin/includes/misc.php on line 1196

    At last I think, that I used your hints in the right way. I checked php-version, which is 7.3.

    Is it possible, to investigate my website with the credentials I gave you last week in the private field.
    That would be verry nice.
    Best regards
    Grobi

    #1154821

    Hi,

    Sorry for the delay. We can’t access the dashboard because of the errors. Please check the snippet in the functions.php file and make sure that “inline_popup_enabler” and “wp_footer” are wrapped in quotes. Or post the FTP details in the private field so that we can edit the snippet in the functions.php file.

    Best regards,
    Ismael

    #1154937

    Hi Ismael,
    OK, I did that and the errors seem to be fixed.

    Best regards
    Grobi

    #1154981

    Hi Grobi,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1154991

    Hi Victoria,
    I think, here is a misunderstanding. With help from Ismael i just fixed the errors as you can see in my post above (#1154270).
    My main problem, that the lightbox pop up does not work is still there.

    Unfortunately I need further assistance.
    Thank you.

    With best regards
    Grobi

    #1155441

    Hi,

    Sorry for the delay. The errors are now gone and we are able to login to the site. Unfortunately, the current account doesn’t have any admin rights, so we couldn’t edit the theme files. Please set the user role of the account to admin and make sure that the Appearance > Editor panel is accessible so that we can edit the files.

    Thank you for your patience.

    Best regards,
    Ismael

    #1155971
    This reply has been marked as private.
    #1156145

    Hi Grobi,

    The quotes were wrong in the functions.php file. The popup shows up now. Please check.

    Best regards,
    Victoria

    #1156347

    Hi Victoria.
    Yes, it works and I am very happy about it.
    Obviously, before including the script into functions.phpI I have loaded it into another program that handled the quotes differently and thus lost the correct PHP-notation.
    I will remember this mistake and keep an eye on it in the future.

    Thank you for the successful troubleshooting.
    Best regards – please also to Ismael
    Grobi

    #1156739

    Hi Grobi,

    Glad we could help :)

    Yes, that often is the case, when the quotes are copied in the incorrect way.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1177689

    Yes, of course, close this topic.
    Thanks a lot.
    Best regards
    Grobi

Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘Lightbox pop up funktioniert nicht’ is closed to new replies.