PHP mobile redirect Endless loop

Disable the plugin at all and in your function.php add add_action(‘init’, ‘my_mobile_redirect’); function get_first_url_subdir() { return str_replace( str_replace( array(‘http://’, ‘https://’), ”, get_site_url() ), ”, $_SERVER[‘SERVER_NAME’] . $_SERVER[‘REQUEST_URI’]); } function redirect_mobile_with_cookie() { $cookiename=”redirect_mobile_is_a_mobile_device”; if ( isset($_COOKIE[$cookiename]) && ($_COOKIE[$cookiename] == ‘yes’) && strpos(get_first_url_subdir(), ‘/mobile’) !== 0) return true; return false; } function my_mobile_redirect(){ if ( redirect_mobile_with_cookie() ) … Read more

using wp_footer hook in a plugin

Firstly, remove the margin-left CSS property from your html and then try if it works. May be your html is being hidden behind any other html. Or better try this first – Remove the current code from your function and just write any non html thing. Then put a die() or exit() and see if … Read more

How do you add a settings page to another menu?

You’d need to create the top-level menu page, and then the sub-menu after that. Here’s an example: function my_menu() { add_menu_page ( ‘MVC Events’, // $page_title ‘MVC Events’, // $menu_title ‘manage_options’, // $capability ‘mvc-events’, // $menu_slug ‘mvc-options’ // $function ); add_submenu_page ( ‘mvc-events’, // $parent_slug ‘ATB Event Options’, // $page_title ‘ATB Event Options’, // $menu_title … Read more