WordPress current URL Cheat Sheet

Input https://juzhax.com/page-name/page/3/?query=data Currrent URL with Pagination and Query String $final_url = “{$parts[‘scheme’]}://{$parts[‘host’]}” . add_query_arg( NULL, NULL ); // Result : https://juzhax.com/page-name/page/3/?query=data Current URL without Query String and ending with slash $current_url = home_url( $wp->request ); $final_url = trailingslashit( $current_url ); or $final_url = get_permalink(); or $final_url = get_page_link(); // If it is page. // Result : https://juzhax.[…]

WordPress current URL Cheat Sheet Read More »