Answer the question
In order to leave comments, you need to log in
How to declare a global variable?
Good afternoon! Can you please tell me how to declare a global variable in Wordpress? And how to use it?
I need to pass variables from the page template to the function. I try so: in a template global $a; $a=5;
in function global $a; echo $a;
But nothing comes out :(
The
task is as follows:
We display records on the main page, but not in the standard way . I already asked, but no one answered.
full filling, so that there are no "holes". As a result, sometimes there are one or two records that are not shown.
At the bottom of the page there is a button "Show more", which Ajax loads the next batch of records.
I need to pass the ID of these records further to the output function, and when the news from the next page that has not yet been shown accumulates, then display the filled line.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question