Rewrite rule help for gallery plugin

I finally got my rewrite rules to work here: $home = get_post(Sunshine::$options[‘page’]); // Gallery add_rewrite_rule($home->post_name.”/gallery/([^/]+)/page/?([0-9]{1,})/?$”,’index.php?pagename=”.$home->post_name.”&sunshine_gallery=$matches[1]&paged=$matches[2]’,’top’); add_rewrite_rule($home->post_name.”/gallery/([^/]+)/?$”,’index.php?p=’.$home->post_name.’&sunshine_gallery=$matches[1]’,’top’); add_rewrite_rule($home->post_name.”/gallery/([^/]+)/?$”,’index.php?pagename=”.$home->post_name.”&sunshine_gallery=$matches[1]’,’top’); // Image add_rewrite_rule($home->post_name.”/image/([^/]+)/?$”,’index.php?pagename=”.$home->post_name.”&sunshine_image=$matches[1]’,’top’);

Top Contributors Plugin with Custom Post Type

This plugin hasn’t been updated in almost two years, so you should consider finding a new one. That said, in this cases you have to open1 the plugin files and search for some string related to your issue, e.g., post_type. You’ll find that in the file functions.inc.php, it has two occurrences of: AND a.post_type=”post” Change … Read more

Images not showing and plugins not installing on wordpress server move

First thing I would do: In your wp-config.php file, hardcode your new site URL by entering define(‘WP_SITEURL’, ‘http://www.example.com’); define(‘WP_HOME’, ‘http://www.example.com’); After that, have a look at the source code of your pages including images, and verify how the URLs of the the images look like. If they are wrong (relative to localhost?), you may have … Read more

Doing action based on input from options menu

You should post to the same URL and catch the submit ex: function option_page_html(){ if (isset($_POST[‘plugin_action’]) && $_POST[‘plugin_action’] == ‘post_url’){ include_once(plugin_dir_path(__FILE__).’post-video.php’); } ?> <div> <form action=”” method=”post”> <p><h3>Paste video url</h3></p> <input type=”text” size=”100″ name=”url” /><br/> <input type=”hidden” name=”plugin_action” value=”post_url”> <input type=”submit” value=”Post”/> </form> </div> <?php } note : this is an example and you should … Read more

Plugin update, is a deactivation and activation done?

According to the source code of wp-admin/includes/class-wp-upgrader.php Single plugin update: add_filter(‘upgrader_pre_install’, array(&$this, ‘deactivate_plugin_before_upgrade’), 10, 2); add_filter(‘upgrader_clear_destination’, array(&$this, ‘delete_old_plugin’), 10, 4); It’ll deactivate the plugin before upgrade and you need to re-activate it manually after upgrade. No maintenance file generated Bulk Pluigns Update add_filter(‘upgrader_clear_destination’, array(&$this, ‘delete_old_plugin’), 10, 4); // Only start maintenance mode if running in … Read more

WP e-commerce sales-view

not really php solution, but that’s how I solved this problem. I deactivated phone and email fields from Store Settings -> Chekout and created custom ones. so now when I go to orders it displays in like Additional Checkout Fields Phone: Email:

How to create custom WooCommerce 2.0 templates

Actually, the templates folder is still included in WooCommerce, just like before. Just copy its contents to yourtheme/woocommerce and, hey presto, it works! N.B. This doesn’t work when you use the woocommerce_content() function in a woocommerce.php. WooThemes actually have a good primer page that they even link from a nag after you have installed WC2.0.