everyone!
I have this code,
<?php
add_action('wp_head', 'app_searched_today_visitbh');
function app_searched_today_visitbh(){
<?php
global $wpdb;
$horas = $wpdb->get_var("SELECT time_format(timediff(now(),date_people),'%H') FROM today_people.date_people LIMIT 1");
}
add_shortcode('appsearchedtodayvisitbh', 'app_searched_today_visitbh');
?>
<div id="time"><?php echo $horas?></div>
I need your knowledge and your help.
I have a problem activating the plugin , it gives an error, in this case the code works to show a number based on the time that is on the table of the db, I need to make the result it shows up in Shortcode
, but I can not find the error.
Thank you very much
IMPORTANT UPDATE.
function app_searched_today_visitbh() {
global $wpdb;
$horas = $wpdb->get_var("SELECT time_format(timediff(now(),date_people),'%H') FROM today_people.date_people LIMIT 1");
return ("<div id='time'>$horas</div>");
}
add_shortcode('appsearchedtodayvisitbh', 'app_searched_today_visitbh');
The code has stayed this way, I only have one more error.
When creating the today_people and add a date_people column and execute the following query INSERT INTO today_people (date_people) VALUES (now());
then activate the plugin, in the front it does not show the result.
I would appreciate any help.