Redirect URL while building site

Let me write a plugin for this (save as wp-content/plugins/red_visitors.php): <?php /** * Plugin Name: Redirect visitors * Plugin URI: http://wordpress.stackexchange.com/questions/138519 * Author: still_learning */ // function based on http://stackoverflow.com/a/5892694/2948765 // I hope it still works function __is_login_page() { return in_array($GLOBALS[‘pagenow’], array(‘wp-login.php’, ‘wp-register.php’)); } // When WP is ready… add_action(‘init’, function() { // Check what … Read more

Unsual behaviour of navigation Menus

Problem was the theme that we purchase didn’t upload the plugins and other Java Script files properly So it was giving an error. Going through theme installation document helped me.

Siteurl code for links

I have a development site as a subdomain of my main site, so I deal with this when I copy data from the live site to the development site to obtain a current version of the development site. First, visit http://codex.wordpress.org/Moving_WordPress#When_Your_Domain_Name_or_URLs_Change like cybnet recommended. Once you have changed the wp-config files as described in the … Read more

A plugin doesn’t show up and refuse to be installed

This is probably just a symptom of the problem of a failed install. If you look at that actual folder on the server it’ll probably be a couple folders, but no php files and a bunch of missing files that are in the plugin zip. Maybe something failing on unzip, or ftp, caused half-installed state … Read more

Images getting corrupt automatically

Check/fix the URLs for the images; they are relative URLs, not absolute. Use Firebug with Firefox, or use the developer tools in Chrome or Safari or IE to see what javascript is loading on your site and the errors.

Need help with restricted page for users

It sounds like you want a membership site that restricts content to certain membership levels. There are several membership plugins available for WordPress and several reviews of the options. One site what has several articles on membership plugins is: chrislema.com

Emailing Authors only when a CUSTOM POST TYPE post is published- not when edited later [duplicate]

Yes, it sounds like you do want a post transition hook, probably draft_to_publish as per the following from the Codex: function your_callback( $post ) { // Code here } add_action( ‘draft_to_publish’, ‘your_callback’ ); Use authorNotification— your function name– instead of your_callback. It should be fairly simple in your case. However, the precise details of your … Read more

Foreach giving one too many list items, how can I remove the last empty line?

I’ve managed to find the answer to my problem of empty custom fields showing on the page. /** Get Fitness Custom Fields from listing page **/ add_filter( ‘woocommerce_single_product_summary’, ‘something_custom_fields’, 23 ); function something_custom_fields() { //Get picture from post meta or template directory $thumb = get_post_meta($post->ID,’Thumbnail’, true); $thumb = ( !empty( $thumb ) ) ? $thumb … Read more

How to add multiple values with add_query_arg?

It’s not “smart” enough to reason that you want to modify the value, not just set it to something. You’ll need to: retrieve the current value (get_query_var() probably) change it as needed use resulting value with add_query_arg()