Answer the question
In order to leave comments, you need to log in
How to glue a function call to the footer several times?
This block sticks the generated modal window to the footer of the site, but if I try to add 2 windows, an error immediately flies, how can I loop the sticking to the footer?
echo 'тут выведем ссылку на вспл. окно';
//сгенерируем всплывающее окно и приклеим в футер
add_action('wp_footer', 'footer_modal01');
function footer_modal01(){
//тут всплывающее окно html которого должен отправиться в футер
}
Answer the question
In order to leave comments, you need to log in
Considering your answer to the previous commenter, you can do something like this:
<?php
echo 'тут выведем ссылку на вспл. окно';
//сгенерируем всплывающее окно и приклеим в футер
add_action('wp_footer', 'footer_modal01');
if(!function_exists('footer_modal01')):
function footer_modal01(){
//тут всплывающее окно html которого должен отправиться в футер
}
endif;
?>
Use one single function, and in the function itself, generate html blocks in a loop. As many as you need.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question