Answer the question
In order to leave comments, you need to log in
Sessions + ACF in WP, how?
The task is this:
when a user enters the site, he is shown 1 manager and he is assigned to him ... by ip or session, wherever he goes, there is one manager everywhere, managers are given in turn,
add_action('init', 'omyblog_init_session', 1);
if ( !function_exists('omyblog_init_session')):
function omyblog_init_session()
{
session_start();
}
endif;
Answer the question
In order to leave comments, you need to log in
Store the number of the last manager issued in the option, put the manager's serial number in the cookie for the user and increase the value of the option by one, as soon as the number exceeds the total number of managers, reset it to zero and start over.
Before outputting the loop, get the user's cookie and output only the right one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question