How to keep track of when a vote is cast?

The following lines of code both store the IP address and time of vote, // $ip holds $_SERVER[‘REMOTE_ADDR’] $voted_IP[$ip] = time(); // Save IP and increase votes count update_post_meta($post_id, “voted_IP”, $voted_IP); The time a vote is cast is already being stored for you in the post_meta table for the given post the person is voting … Read more

How do I define a lookup table that will work across all PHP elements of the template?

Loading it in the header should work, or on the init hook. You will need to declare it global as well. So… // define global $trans_home; $trans_home = array(‘en’ => ‘Home’,’it’ => ‘Home’,’de’ => ‘Home’,’zh’ => ‘首页’,’es’ => ‘Página de inicio’,’fr’ => ‘Page d\’accueil’); // and use in your templates global $trans_home; echo $trans_home[qtrans_getLanguage()];

JQuery prepend a function

The admin_menu hook is not for displaying the menu, it’s actually part of the menu construction process to figure out exactly what goes in the menu, and this is where you should be making calls to functions like add_submenu_page. So when this action is fired, nothing has been printed out yet, there’s no head/body tags … Read more

Check IF single OR multiple custom data has been entered

Since you already using get_post_custom a slightly cleaner yet still dirty (php) way of doing it. $sermondata = get_post_custom($post->ID); if( isset($sermondata[‘sermon_audio’]) || isset($sermondata[‘sermon_video’]) || isset($sermondata[‘sermon_document’])) { ?> <div id=”downloads”> // rest of your echo output </div> <?php } ?> ps . Just make sure the value is not null, to be safe you can combine … Read more

First Byte Time (back-end processing)

That is a huge question and it is going to be hard to answer. And it is going to take a lot of research and trail and error on your part. As far as WordPress specific things go, analyze your code base. Poorly written plugins or themes can cause huge delays. A 3 second backend … Read more

how can I do something on new user registration?

You want to use the user_register hook, probably. Then use the Filesystem API to make the folder. Be aware that filesystem manipulation is dependent upon server configuration and may not always work, but using the API should ameliorate that problem as much as possible.