Best way to pass arguments to another page in WordPress
Use add_query_arg() to do this. Here’s a useful function if you need to get the current page URL (when get_permalink is inaccesible, like on Archives): function get_current_page_url() { $request = esc_url($_SERVER[“REQUEST_URI”]); $pageURL = (is_ssl() ? ‘https’ : ‘http’).’://’; if ($_SERVER[“SERVER_PORT”] != “80”) $pageURL .= $_SERVER[“SERVER_NAME”].”:”.$_SERVER[“SERVER_PORT”].$request; else $pageURL .= $_SERVER[“SERVER_NAME”].$request; if (false === strpos(get_option(‘home’), ‘://www.’)) $pageURL … Read more