Hot answers tagged

1

You can use the function get_the_author_meta() to get the emailaddress of the author of the current post and the wp_mail()function to send an e-mail <?php $timelimit=1 * 604800; //1 week * seconds per day $post_age = date('U') - get_post_time('U'); if ($post_age < $timelimit) : ?> // Current <?php elseif ($post_age > $timelimit) : $...


1

There are three problems 1. echo and php tags within an echo Change your first echo from: echo '<img src="http://img.youtube.com/vi/<?php echo get_post_meta($post->ID,'video_url',true);?>/0.jpg"/>'; to this: echo '<img src="http://img.youtube.com/vi/' . get_post_meta($post->ID,'video_url',true) . '/0.jpg"/>'; 2. if statement ...


1

I would suggest checking out a geolocation service to lookup the location of the users IP address, such as freegeoip.net. In order to do this you would need to make a rest api get request either through php or javascript. To get the ip address of the visiting user you can read in <?php echo $_SERVER['REMOTE_ADDR']; ?> then send that off to the ...



Only top voted, non community-wiki answers of a minimum length are eligible