How to deactivate my plugin upon deactivation of NextGen

You’ve got to actually check is_plugin_active. I would use something more like this, shamelessly stolen and modified from here: register_activation_hook( __FILE__, ‘dependentplugin_activate’ ); function dependentplugin_activate() { require_once( ABSPATH . ‘/wp-admin/includes/plugin.php’ ); if ( is_plugin_active( ‘nextgen-gallery/nggallery.php’ ) ) { require_once ( WP_PLUGIN_DIR . ‘/nextgen-gallery/nggallery.php’ ); } else { // deactivate dependent plugin deactivate_plugins( __FILE__); // throw … Read more

looking for a multi-user hello-world plugin

You write things the same way. Essentially, plugins in a multi-site environment come in three different flavors: Single site plugins Network plugins Must-use plugins Single site plugins are installed on the network administration page and activated on each individual site. Network plugins are installed on the network administration page and activated from the same location. … Read more

Filtered content appears in the excerpt

If there are no manual excerpts added to the Post, WordPress picks the content itself as excerpt for that Post. You may either put the excerpts for Posts manually or apply_filter(‘the_excerpt’, ‘modify_excerpt’) and remove the unwanted text from the excerpt. The function code-structure will remain almost the same, with the exception that now you will … Read more

Pagination not working

See Pagination Parameters under WP_Query in Codex: Since WordPress 3.0.2, you do get_query_var( ‘page’ ) instead of get_query_var( ‘paged’ ). The pagination parameter ‘paged’ for WP_Query() remains the same.

Publishing a video from blog to youtube

If there’s a plugin, it has to be found. If not, a custom solution has to be written. But YouTube does provide an API for that. YouTube API v2.0 – Direct Uploading This page explains how to upload videos to YouTube using direct uploading. Direct uploading lets you add videos that are in your video … Read more

Pdf visualiser embedded into wordpress website

You can put this in your theme functions.php file, It will work in any browser ( I tested this since it uses an iframe) and auto embed .pdf files from the media tab when you click “insert into post”. You can alter the width and height parameters for the size when its added to the … Read more

How can I create custom in-post templates?

First of all : Cool idea. I don’t know whether there exists a plugin for this task, but I would simply implement this as a new small plugin. I would recommend changing your syntax, so that it won’t contain the links as html. I changed it to: {{previousKnowledge|first=…|second=…}} Here is my simple first approach : … Read more

WordPress Stats Plugin: Display Post Views [closed]

Put this into your functions.php file: function userfunc_get_post_views($postID) { global $post_stats; foreach ( $post_stats as $p ) { if ( $p[‘post_id’] == $postID ) { ?> <span class=”stats-post-views”> <?php echo number_format_i18n( $p[‘views’]) . ‘ views’; ?> </span> <?php } } } and then into your single.php file where you want the views to be displayed: … Read more

Plugin Add New Installer failing

Was your plugin uploaded to /uploads directory on the server after you pressed “Upload”? If “Yes”, have you added “Connection Information” after that? If “Yes” again, it could be server configuration issue.