The the_permalink()
function links to the single post view for the given post-type. As per the Template Hierarchy, the page used to render the single post view is single.php
.
So, if you want to modify the template used to render the page when clicking the_permalink()
, create/modify single.php
, or for a specific post-type, create/modify single-{posttype}.php
.
If you want to reference the referring page, you may want to look at hooking into template_redirect
, and referencing $REFERRER
, or something.
Related Posts:
- Need help with add_rewrite_rule
- Removing Parent Page(s) from Permalink
- Prevent WordPress from abbreviating-long-slugs…-in-the-admin
- Page begins with number, WordPress adds 2
- Permalinks to Custom does not work (out of box)
- Why don’t WordPress post slugs allow accents?
- Multi-language permalink in qtranslate
- Modify get_permalink with a specific filter
- Include Taxonomy slug in post url
- Nice RSS Feed URLs for each custom post type
- How to set permalink to fetch all children custom posts with parent post in wordpress?
- Rewrite url / permalink for default archive – yearly / monthly
- Should I use relative or absolute urls when pointing to internal pages
- WordPress on VirtualBox – no pretty permalinks
- permalinks has -2 with post name structure. why?
- How can I change permalinks to use a different domain and path from where the blog is hosted?
- Gutenberg Editor: dynamicaly change slug field with an ACF field
- Child pages with same slug
- Permalinks, Rewrites, Get Variables, Oh My!
- Remove words from permalink when saving post automatically?
- Permalink problem
- Can’t get rewrite rules working
- Removing leading zeros from custom permalink structure
- When is it a good idea to build a permalink structure from scratch?
- How to reset canonical URLs / fix redirect loop
- Permalinks not working Apache + CentOS 7
- Trailing slash at the end of permalink loads faster / better SEO?
- How to show the homepage on a different url, like site.com/blog instead of site.com?
- Post incorrectly displaying as page
- WordPress blog posts permalinks giving 404 on nginx
- Permalinks by page/post name returning 404
- why does my url not update after migration?
- Dynamically create Permalinks for uploaded files?
- Get new WordPress slug from old wordpress slug
- Changing the post date without causing 404 error
- Rewrite rule for a query string
- Why does the ‘Month and Name’ Permalink Format not Work on my new WordPress Site (running on IIS7)?
- How do I add /blog/ as a prefix to permalink structure for posts, categories & tags?
- Is it possible for a custom post type and sub pages of a page with the same slug as the custom post type to share a slug?
- Why is page/2/ not working?
- force permalink slug for page vs post_type slug parent
- Rewrite URLs for LeadPages due to subdirectory installation
- After updage wordpress 4.4 to 4.5 nginx config works not properly
- Permalinks stopped working – NO update, mod_rewrite enabled, .htaccess not touched
- A link to a page including an anchor doesn’t go to that anchor – URL gets changed
- Default permalink changes
- Changing permalink name redirects to another template?
- WordPress Permalink feature alternative
- How can I emulate permalink behaviour on static pages
- add_query_vars and canonical links
- Unique one time use URL
- the_permalink on the homepage vs posts for sharing links
- Media/attachment urls don’t redirect with fake URL structure
- when I create a page with a /blog permalink the css gets messed up
- Strange behavior: random HTTP error 500 fixed by visiting Permalinks settings page (htaccess issue with language code)
- how to prefer static page if it exists over wordpress page
- Remove a link from a page ID used within an array [closed]
- How can I link to the author’s page
- Why will Pretty URLs not Work?
- Get Posts Based on Tag Matching Page Title
- Rewrite rule not passing variable
- Passing variable as permalink URL
- “set_front” => false on custom post type breaks wp_list_categories links [closed]
- Customizing a permalink
- post preview/thumbnails not displaying correctly- linking to “home” instead of post?
- Moving blog and maintaining current permalinks
- All pages load the home page if pretty permalinks are used
- where can i see wordpress automatic redirect History
- WordPress keeps removing query var from the URL
- How can I access to the same post-type “page” from multiple different urls?
- Multiple URL rewrite rules and get every prams
- WordPress url customization
- permalink not showing correctly using wp_insert_post and post_name
- 404 error on published page with specific permalink
- Changing category base breaks permalinks
- Added .html to Woocommerce permalink but pagination don’t work!
- Subpages getting a 404 error after changing Parent page URL
- My permalinks for all pages and posts now include old page titles as parents/categories
- Updating wordpress permalinks to use https://
- WordPress Pagination Custom Rewrite Rule for Pages
- Is it possible to use % sign in post permalinks?
- Remove/hide a specify category-name from the url
- Page permalink ending in “-2”
- rewrites and custom links in page need help with add_rewrite_rule
- Change the permalinks structure
- How to create an IIS7 re-write rule for a single category
- All pages lead to home
- Although rewrite engine is on, I get 404 not found on every page
- how to change permalinks from id to name of a particular location
- Using a taxonomy value as part of a post URL
- Permalinks of New Pages and their Parents
- Leverage permalinks with AJAX
- Why do I have “category” in my permalinks?
- Getting the Posts’ permalinks from XLMRPC
- WordPress: Permalinks link to old names
- How to get the perfect WordPress, WooCommerce, Custom Post Type pretty permalinks?
- WordPress keep redirecting me to random URLs
- How to make a permalink variable %year% become two digits instead of four digits?
- Settings > Permalinks – mod_rewrite ineffective if expression not preceded by /index.php/
- Standard Htaccess directives disappear by themselves