WordPress – Display Performance Stats

Copy and place inside your child themes functions.php

add_action('wp_footer', 'show_template');
function show_template()
{
if ( is_user_logged_in() )
{
echo '
';
echo 'queries: '.get_num_queries().'
';
echo 'Page generation took: '.timer_stop().'
';
echo 'MB Peak Memory Used: '.round(memory_get_peak_usage() / 1024 / 1024, 3).'
';
}
}

Tweetily – Adding Custom Post Types

If you would like to add custom post types to be tweeted by the plugin,  (http://wordpress.org/plugins/tweetily-tweet-wordpress-posts-automatically/) then follow the steps below.

1. Open top-core.php
2. Find lines +- 95

` $sql = “SELECT ID
FROM $wpdb->posts
WHERE $pt post_status = ‘publish’
“;
`

3. From the Admin Page of Tweetily, choose ALL (Both pages and posts)

4. Modify the above line as follows (use your values)
`
$sql = “SELECT ID
FROM $wpdb->posts
WHERE $pt post_status = ‘publish’
AND($wpdb->posts.post_type = ‘CUSTOM_POST_TYPE-1’
OR $wpdb->posts.post_type = ‘CUSTOM_POST_TYPE-2’
OR $wpdb->posts.post_type = ‘posts’
OR $wpdb->posts.post_type = ‘pages’) “;

If you want to take out posts/pages/ just comment out the code or remove.

TIP: Save a copy of this file, incase the plugin is updated then you can do a diff on the two and make the necessary changes again.
`

5. Do a Test Tweet and reload your page.

 

Please let me know if this worked for you.