Adding this snippet to your WordPress theme will let you check to see if a post contains the gallery shortcode. Add this code to the single.php template of your WordPress theme inside the loop. if (get_post_gallery() ){ echo ‘has gallery’; } else { echo ‘has no gallery’; } If you want to show the gallery
Remove XML-RPC when not in use for performance boost
WordPress uses a CURL operation to test for SSL capability for XML-RPC. If you’re using XML-RPC but not using, then you can remove the filter. This is a small performance boost (since basically WP does a cURL GET on the https url and either 1) gets a denied message, or 2) times out, and it
Display DB Queries, Time Spent and Memory Consumption
function performance( $visible = false ) { $stat = sprintf( ‘%d queries in %.3f seconds, using %.2fMB memory’, get_num_queries(), timer_stop( 0, 3 ), memory_get_peak_usage() / 1024 / 1024 ); echo $visible ? $stat : “<!– {$stat} –>” ; } Then this code below the code above which will automatically insert the code above into the
Change the length of Exerpt
By default all excerpts are capped at 55 words. Utilising the code below you can override this default settings: function new_excerpt_length($length) { return 100; } add_filter(‘excerpt_length’, ‘new_excerpt_length’); This example changes the excerpt length to 100 words, but you can use the same method to change it to any value.