Best practice for including plugin output in a template without using shortcode?

<?php // A) // inside your template if ( function_exists( ‘the_attachment_stuff()’ ) ) { // do stuff } // better/faster if ( class_exists( ‘attachment_plugin_class’ ) ) { // do stuff } // B) // inside your template do_action( ‘the_attachment_suff’); // means setting this inside your plugin // this avoids throwing errors or aborting if the … Read more

Recent posts per category loop?

here is a quick one: (edit: I updated some forgotten punctuation). <?php /* Plugin Name: Recent posts per category loop Plugin URI: http://en.bainternet.info Description: answer to http://wordpress.stackexchange.com/questions/16616/recent-posts-per-category-loop Author: Bainternet Version: 1.0 Author URI: http://en.bainternet.info */ // Initialization function function WP_Widget_display_widget_init() { new WP_Widget_display_widget(); } // Your Class class WP_Widget_display_widget extends WP_Widget { // Constructor function … Read more

syntax highlighting and

Indeed, you need to convert the code to their HTML entities to prevent WordPress (or the TinyMCE editor) from stripping it out. The Visual editor does some of this work for you, in the HTML editor you must do this yourself. Fortunately, there are syntax highlighter plugins (also based on the same SyntaxHighlighter Javascript library) … Read more

Speeding SQL queries for a large database?

Your log shows that MySQL is performing a linear scan of all table records to get the necessary row – this is because there is no index for guid Assuming wp_rb_posts is just the normal posts table with a slightly modified prefix, then you can just add an index for that field, and you’ll see … Read more