Jump to content

multiple mobile redirects form value problems...


uniquelylost

Recommended Posts

Hi, I have been working on coding multiple mobile redirects that can be entered via a form... I can get it to work fine without the form but once I introduce the form I can only get the first redirection to work and if I try to add additional ones like 'pagetitle_url22' they don't work... I can confirm that the values are getting saved in the db... here's an example of my code-

function emr_single_page_only(){
		global $emr_options;
		if (is_page(get_option('page_number11'))) {
			emr_mobile_redirect();
		}
		elseif (is_page(get_option('page_number22'))) {
			emr_mobile_redirect2();
		}
	}
	add_action('get_header','emr_single_page_only');

function emr_mobile_redirect(){
		global $emr_options;
		if ($emr_options['enabled'] == true)
		{
			$detect = new Mobile_Detect();
			if ($detect->isTablet() && $emr_options['tablet'] == true)
			{
				$detect = "false";
			}
			elseif ($detect->isMobile())
			{
				header('Location: ' . $emr_options['mobile_url']);
				exit;
			}
		}
	}
function emr_mobile_redirect2(){
		global $emr_options;
		if ($emr_options['enabled'] == true)
		{
			$detect = new Mobile_Detect();
			if ($detect->isTablet() && $emr_options['tablet'] == true)
			{
				$detect = "false";
			}
			elseif ($detect->isMobile())
			{
				header('Location: ' . $emr_options['mobile_url22']);
				exit;
			}
		}
	}

Any suggestion are appreciated!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.