if you’re using a page template, then if you want to get the current page URL you could try to use this function:
get_permalink();
or
echo get_permalink();
if you want to print the result
Related Posts:
- What does is_page_template() compare against?
- Creating custom blog page template the right way
- is_page_template not working
- When is get_template_part() preferable to simply using the template.php files?
- How to remove all styles for certain page template?
- Simplest way to add a second html editor to the post/page admin?
- How to consolidate multiple static page templates into one dynamic one?
- How to inject custom url path for page ?
- Store Page Template Files in a Subfolder
- How to remove a parent theme template from Quick Edit?
- How to Set a Custom Template for Blog Posts
- Removing or Restricting Access to Page Templates for Editor Role
- Created custom post type but selected template not staying selected
- Can I create a page template, use it once, then hide/remove the option to use it again?
- Are page/post IDs unique across a whole network?
- Custom template for each page
- Adding the Admin Bar to a page with a custom template
- Can you call a template file without assigning template to a page in the admin panel?
- page-slug goes to not found
- How do I add a body class to specific pages?
- How to list all titles of posts on a specific page?
- How to create a page template that retrieves content from db?
- Change path of the page’s template
- wp_redirect() does not work in custom template file
- Get page id of current page from template [duplicate]
- is_page_template returning false
- get_pages — parent vs child_of?
- Excerpts for Pages
- Visual Editor Templates
- Change content of page in child theme using plugin
- Can two custom templates be used to create a single page?
- Find the page template of the previous page
- Create a page template with No Footer
- How to check if a specific page uses a page template?
- Cant remove line that appears above page content
- I want to duplicate homepage for all my pages
- How to rewrite title- and meta-description templates for page templates in Yoast Plugin [closed]
- Adding a Menu Page to The Dashboard
- Cleaner way to define multiple variables for is_page_template()
- page shows 404 on form submit
- Is it possible to add a child post into the parent page?
- wp_redirect goes to infinity loop
- Is it okay to use page template as contact page? [closed]
- Display one post in different formats conditionally
- Including facebook.php in a wordpress page template?
- is_front_page and is_home are not working in page.php
- Custom Page Templates
- How to build a PDF repository in WordPress
- Page with posts from category doesn’t work
- Why is a renamed custom template file still showing up in the template dropdown menu?
- Page template added via plugin not saved in Gutenberg
- Strip from the_tags() output
- How can I load 2 random pages?
- Blog page wont use blog-template.php
- Delete post: 2 wp_redirect if pages are different
- Template Redirect to /2015 to use page template
- The best way to create pages like an ‘about’, ‘contact’ and etc [closed]
- Image not showing on page template in Twenty Fifteen-theme
- How to set custom cookies in WordPress after a form is filled on a page
- Three step order form, how to go to next step
- Limit page template choice by page title or ID?
- WordPress custom login and register page problem?
- Using conditional statements in place of custom Page templates
- Controlling the Admin panel for page templates
- Page Templates automatically showing index page contents?
- RSS feed for a custom page template
- Add featured image as post header background image
- Create Page with Pagetemplate and get a post_type_object->template
- WordPress pass url to page template when page does not exist
- Inserting article:tags meta in html head-element, using get tags, no wp_head
- wp_logout() not working after form submission
- Set page title in WordPress with PHP
- How to allow user to select page template from front end?
- Converted HTML5 to WP, How to apply converted classes to new pages (after conversion completed)
- Custom page template displays the archive template
- page_template filter without a plugin
- How to get template link?
- Using a page-template to restrict access based on IP (Frontend)
- Need help in creating splash intro page using custom page template
- Adding secondary featured image for page_for_posts
- What is the best way to create very custom campaign pages?
- WordPress fetches the archive page instead of my custom template
- Custom Forget Password page
- How do you create a default template?
- Cannot display default template after switching to custom
- A simple form submission but notice : Trying to get property of non-object
- Using page template as Static Front Page
- Custom Page Template not working when site moved from subfolder
- How to make page template with admin able to select NextGen Galleries to be part of the layout?
- Showing sidebar-2 on custom template page
- Background of default template showing instead of the background of custom page template
- Page (template) with only news of the type “gallery”
- Getting a custom area in a theme for dynamic content for page
- Videopress Short Tags not working when pulling page into template
- Article Template
- Front end user registration form [closed]
- How to show feature image, Title, Breadcrumb before Page in flatsome theme
- WordPress Page Slug with URL custom template
- Can wordpress search inside a custom page template?
- Extra HTML code added to my (on Chrome DevTools) but not on source code