getdave / Tanlinell

Boilerplate Wordpress theme for rapid development of new WP themes. Based on the great work of the _s ("Underscore") theme.
GNU General Public License v2.0
6 stars 2 forks source link

fix this #320

Closed neilberry001 closed 10 years ago

neilberry001 commented 10 years ago
    global $post;
    if(!empty($post->ID))
        $theID = $post->ID;
    else
        $theID = false;

    $site_details = array(
                            'templateDirectoryUri'      => get_template_directory_uri(),
                            'siteUrl'                   => get_site_url(),
                            'thePermalink'              => get_permalink(),
                            'theTitle'                  => get_the_title(),
                            'theID'                     => $theID
                        );
    wp_localize_script('modernizr', 'tanlinellSiteDetails', $site_details );

Reoslves PHP Notice: Trying to get property of non-object in ... /wp/wp-includes/post-template.php ...