CodeHQ

Archive for December, 2016

|

Get author Twitter handle | WordPress

Friday, December 30th, 2016

$twitterHandle = get_the_author_meta('twitter');

echo $twitterHandle

Tags: , , ,
Posted in PHP, WordPress | No Comments »

Custom fields in custom taxonomy archive page | WordPress

Thursday, December 1st, 2016

$queried_object = get_queried_object(); 
$taxonomy = $queried_object->taxonomy;
$term_id = $queried_object->term_id;
the_field('custom_field_name', $queried_object);

Tags: , , , , , ,
Posted in PHP, WordPress | No Comments »

jQuery in the footer

Thursday, December 1st, 2016

Add this to your functions.php

function my_init()   
{  
    if (!is_admin())   
    {  
        wp_deregister_script('jquery');  
  
        // Load a copy of jQuery from the Google API CDN  
        // The last parameter set to TRUE states that it should be loaded  
        // in the footer.  
        wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js', FALSE, '1.11.0', TRUE);  
  
        wp_enqueue_script('jquery');  
    }  
}  
add_action('init', 'my_init');  

Tags: , , , , ,
Posted in jQuery, PHP, WordPress | No Comments »