Support

Account

Home Forums ACF PRO verify get_field value and redirect to a page Reply To: verify get_field value and redirect to a page

  • Hello, you can try something like:

    <?php
    $model_name = get_field('model_name');
    
    switch ($model_name) {
        case 'iphone':
    		/* if no page output / print / echo to this function */
    		$redirect = "http://www.yourlinkredirect.com";
    		header("location:$redirect");
        break;
        
    	case 'samsung':
            /* with javascript help */
    		echo '<script language="JavaScript"> 
    					window.location="http://www.yourlinkredirect.com"; 
    			  </script> '
        break;
        
    	case 'others':
            /* ... */
        break;
    }
    ?>

    I hope that helps, hug…