How to debug function file causing white screen

It sounds like there is a fatal error occurring, but you aren’t displaying errors on the page. To enable debugging you should add the following code to your wp-config.php file. define( ‘WP_DEBUG’, true ); *note: if your wp-config.php file already contains an entry for the above, make sure it’s set to true. Once you know … Read more

How can I display a query in a page?

You can use the $wpdb object // Print last SQL query string $wpdb->last_query or: <?php if (current_user_can(‘administrator’)){ global $wpdb; echo “<pre>”; print_r($wpdb->queries); echo “</pre>”; }//Lists all the queries executed on your page ?> You might have to set define(‘SAVEQUERIES’, true); in wp-config.php

Language Switch Function

You are now only testing for the theme location not to be empty. This means that every non empty menu location will see the language button attached. So, in stead of testing for emptyness you should be testing for a specific location. The name of that location depends on your theme, but suppose it’s called … Read more

Place content inside the Post Loop

Just as the loop starts the action loop_start fires. Once each post is setup as the loop iterates, the_post fires. After the loop has finished, loop_end fires. Each of these actions receives a reference to the queried object if you need to check for context. If you are in control of the theme code it … Read more