Filtering out specific post formats from certain pages

Since you’re going to be modifying either the Loop Query or the Loop output, I would recommend modifying the appropriate template files directly. To filter out Posts with the “quote” Post Format, simply wrap your Loop output (inside of the if-have-posts-while-have-posts-the-post) with: if ( ! has_post_format( ‘quote’ ) ) { // Loop output goes here … Read more

CSV file generation failing

Try this: <?php header(“Content-type: application/csv”); header(‘Content-Disposition: inline; filename=”export.csv”‘); // change this filename include (‘../../../wp-load.php’); // may need to change number of “../” depending upon location global $wpdb; $rows = $wpdb->get_results (“SELECT * FROM {$wpdb->prefix}table_name”); // change the table name echo strtolower(implode(‘,’, array_keys((array)$rows[0]))) . “\r\n”; // fixes an Excel bug if the first column is “ID” … Read more

Overriding functions in wordpress plugins

If the plugin displays content via any function, the code: if(!function_exists(‘function_name’)) function_name(); … is used for safety. If your plugin is disabled, and the if (!function_exists(‘function_name’)) is missing, your theme will throw a fatal error.

Getting WPTouch and W3 Total Cache to Work Together [closed]

See: http://wordpress.org/support/topic/wptouch-w3-total-cache-must-disable-browser-caching You’ll need to add that long list to Rejected User Agents under Page Cache, Minify and CDN. If your concerned about the browser caching issues when switching between mobile vs. normal themes, you’ll need to add some query string pattern in the reject URIs field on the page cache settings tab.

Working with wordpress plugin and theme templates structures

If this is a plugin you should really keep the files in your plugin folder. Alternatively you can use the theme folder under it’s own name separate from the active theme. I have seen the latter done and it works fine but you don’t want some unsuspecting users to activate it by mistake. You should … Read more