I'm trying to use the get_permalink function to display the current post/page URL on the frontend. The following code runs fine but does not print the query string. How to display the full URL including the query string?
// Short code: [current-url] function current_url() { return get_permalink($post->ID); } add_shortcode( 'current-url', 'current_url' ); ```
use this code for it