What is the best way to output plugin result in certain url

There are two steps: function my_plugin_rewrite_rule() { global $wp; $wp->add_query_var( ‘show_hello_world’ ); add_rewrite_rule( ‘show-hello-world/?$’, ‘index.php?show_hello_world=1’, ‘top’ ); } add_action( ‘init’, ‘my_plugin_rewrite_rule’ ); That takes care of rewriting. Remember to flush the rewrite rules. Now, your plugin can check for get_query_var( ‘show_hello_world’ ); and load a certain file: function my_plugin_template( $path ) { if ( get_query_var( … Read more

Integrating plugins in themes

1) Is integrating plugins a common practice? Not really. Normally you got a theme that offers a base functionality. You then only extend the theme with plugins for special purpose like twitter stuff, event calendars, etc. Imo it makes sense. I’m currently working on an extremly slim theme that has some plugins (OOP approach) that … Read more

WordPress A-Z Navigation

Isnt it simpler and free from the need using plugin (always depending on the need for the author to update to the current wordpress version) to just use tags and just get all the tags (thus getting all the posts) of the letter “a” for example ?

Override dynamic_sidebar() in plugin?

dynamic_sidebar() calls wp_get_sidebars_widgets() to get the list of all sidebars and their widgets. This output is filtered through sidebars_widgets, so you can modify it to add or remove widgets. This array only contains widget IDs, so you need to register the widget instance too (it should end up in the global $wp_registered_widgets array). I think … Read more

WP Config for FTP credentials

define(‘FS_METHOD’, ‘ftpext’); define(‘FTP_BASE’, ‘/path/to/wordpress/’); define(‘FTP_CONTENT_DIR’, ‘/path/to/wordpress/wp-content/’); define(‘FTP_PLUGIN_DIR ‘, ‘/path/to/wordpress/wp-content/plugins/’); define(‘FTP_PUBKEY’, ‘/home/username/.ssh/id_rsa.pub’); define(‘FTP_PRIKEY’, ‘/home/username/.ssh/id_rsa’); define(‘FTP_USER’, ‘username’); define(‘FTP_PASS’, ‘password’); define(‘FTP_HOST’, ‘ftp.example.org’); define(‘FTP_SSL’, false); http://digwp.com/2010/11/ftp-in-wpconfig/

scheduled event not getting executed

You can’t add an action to wp_head inside a wp-cron job. The wp-cron tasks run outside of the normal flow, so while you can add your action, it won’t actually do anything to anybody viewing the page. Cron jobs are called via separate http requests, no user normally will see their results. In other words, … Read more