Functions Error: Impacting Galleries

You can try to add the condition $query->is_main_query() in your if-sentences so it won’t affect the gallery queries: // Posts per page add_filter(‘parse_query’, ‘wpq_parse_query’); function wpq_parse_query($query) { if(!$query->is_main_query()) { return $query; } if($query->is_archive()) { $query->query_vars[‘posts_per_page’] = get_option(‘to_count_archives’, 1); } if($query->is_home()) { $query->query_vars[‘posts_per_page’] = get_option(‘to_count_home’, 1); } if($query->is_search()) { $query->query_vars[‘posts_per_page’] = get_option(‘to_count_search’, 1); } return $query; … Read more

customize wordpress database error page

This works fine for me as db-error.php in wp-content: Delete the mailer block if you don’t want it <?php header(‘HTTP/1.1 503 Service Temporarily Unavailable’); ?> <?php $to = “[email protected]”; $subject = “My Database is down”; $message = “My Database is down”; $headers = “MIME-Version: 1.0\n”; $headers .= “Content-type: text/plain; charset=iso-8859-1\n”; $headers .= “X-Mailer: php\n”; $headers … Read more