admin-ajax.php not working properly on subdomains

Don’t bother with the complicated cookie/ajax nonsense, use a REST API! We’ll use dependency injection and RESTful APIs to remove the cookies and simplify your AJAX code. First things first, lets turn this into a REST API: class Stuff { public function __construct() { add_action( ‘rest_api_init’, function () { register_rest_route( ‘soothsayer/v1’, ‘/current_rate/’, array( ‘methods’ => … Read more

PHP header() not available to use in my plugin

You see that error because something is sending output (even space characters) before the header-location command. The error message tells you where the output is coming from. To fix, you’d have to edit that file – not a wise choice to edit core files, because the next update will overwrite your changes. Assuming your plugin … Read more

Set plugin page as homepage

There are a few methods to accommplish this goal. Easiest in my humble opinion is to do a HTACCESS Redirect such as Redirect 301 / http://conradbowenrealestate.com/homes-for-sale-search/ Another method would be to use the wp_redirect function as shown in the codex add a new function and include a code snippet like the one below to your … Read more

How to add HTML to a template only when user is logged out/ not registered

First of all, your shortcode usage code is incorrect, correct code is: echo do_shortcode(‘[loginout_button]’); Now, if you want to echo the login/logout button only when user is not logged in, you can use the function is_user_logged_in(). There are two ways to do this 1). Conditional logic inside your shortcode. add_shortcode(‘loginout_button’,’add_loginout_button’); function add_loginout_button() { if ( … Read more