Detecting $_GET parameters from any page + Cookie

This should work, though untested. <?php add_action(‘send_headers’, ‘affiliate_redirect’); function affiliate_redirect() { // it’s possible to use ‘if( !empty( $_GET[‘affid’]) )’ if( isset($_GET[‘affid’]) && ” != $_GET[‘affid’] ) { if( empty($_COOKIE[‘affid’]) ) setcookie(‘affid’, $_GET[‘affid’], time()+2592000, “https://wordpress.stackexchange.com/”); header(‘Location: http://mysite.com/about/’); exit; } }

Any way to use a custom Parameter for youtube embed without using an iframe?

No need for a plugin, You can simply use the Oembed class’s oembed_result filter hook like this: function Oembed_youtube_no_title($html,$url,$args){ $url_string = parse_url($url, PHP_URL_QUERY); parse_str($url_string, $id); if (isset($id[‘v’])) { return ‘<iframe width=”‘.$args[‘width’].'” height=”‘.$args[‘height’].'” src=”http://www.youtube.com/embed/’.$id[‘v’].’?rel=0&showinfo=0″ frameborder=”0″ allowfullscreen></iframe>’; } return $html; } add_filter(‘oembed_result’,’Oembed_youtube_no_title’,10,3); so just paste this code in your theme’s functions.php file, setup the width and height … Read more

Pulling a parameter out of the URL of a WP link without “?” or being sent to a different page

Supposing you have a page created with the slug “referral”, you can add another segment to the page URL containing the employee ref number like this: 1- Register a new query variable e.g “employee_ref” add_filter(‘query_vars’, function ($query_vars){ $query_vars[] = ’employee_ref’; return $query_vars; }); 2- Using add_rewrite_rule function, add a new rule for the ’employee_ref’ to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)