-
AuthorPosts
-
October 28, 2019 at 3:51 pm #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
GrobiOctober 29, 2019 at 10:11 am #1152006Hey 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,
IsmaelOctober 30, 2019 at 6:28 pm #1152449Hi Ismael,
thanks for your informations.
I will work this through und keep you informed.
Best regards.
GrobiOctober 31, 2019 at 3:05 pm #1152733Hi Grobi,
Glad we could help :)
If you need further assistance please let us know.
Best regards,
VictoriaOctober 31, 2019 at 3:22 pm #1152747Hi 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
GrobiNovember 1, 2019 at 11:18 am #1152968Hi,
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,
IsmaelNovember 1, 2019 at 2:58 pm #1153063Hi 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
GrobiNovember 6, 2019 at 12:54 pm #1154270Hi 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
GrobiNovember 8, 2019 at 3:53 am #1154821Hi,
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,
IsmaelNovember 8, 2019 at 11:42 am #1154937Hi Ismael,
OK, I did that and the errors seem to be fixed.Best regards
GrobiNovember 8, 2019 at 1:29 pm #1154981Hi Grobi,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
VictoriaNovember 8, 2019 at 1:39 pm #1154991Hi 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
GrobiNovember 11, 2019 at 1:49 am #1155441Hi,
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,
IsmaelNovember 12, 2019 at 11:51 am #1155971This reply has been marked as private.November 12, 2019 at 9:03 pm #1156145Hi Grobi,
The quotes were wrong in the functions.php file. The popup shows up now. Please check.
Best regards,
VictoriaNovember 13, 2019 at 11:25 am #1156347Hi 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
GrobiNovember 14, 2019 at 12:34 pm #1156739Hi 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,
VictoriaJanuary 23, 2020 at 4:12 pm #1177689Yes, of course, close this topic.
Thanks a lot.
Best regards
Grobi -
AuthorPosts
- The topic ‘Lightbox pop up funktioniert nicht’ is closed to new replies.