The answer lies in your question already…
When you use get_permalink
for your post 171, it gets you
https://mysite/2018/11/24/152-revision-v1
So, as you can see, this post is not a published post, but a revision of a post. Revisions are not public, so you can’t see them…
So how to solve that?
You’ll have to check the correct ID of a post you want to link to and replace 171
with that ID.
Related Posts:
- Changing permalinks gives me 404 errors on nginx
- Strange permalink issue: can’t rename /company-2/ to /company/
- Using $_GET variables in the URL?
- Move WordPress to subdirectory, keep ALL URLs
- ‘post_type_link’ filter not working
- Update URL Snippet to Canonical Permalink URL
- WordPress permalinks Yahoo hosting(no .htaccess allowed)
- How do I turn off 301 redirecting posts (not canonical)?
- How can I include a query string with get_permalink
- Permalink: postname EXCEPT for blog
- %tag% in permalink not working
- Change website URL without breaking links or images? WP 3.3
- How to identifty post from its URL in 404 page?
- Rewrite rule never matching
- How to get blog id from permalink?
- Custom url for a single page
- Rewrite-Rules not working on a vhost, everything goes to index.php
- Rewrite URL for results of a custom WP_Query
- Using ‘Primary Category’ in URL
- template_include not loading -instead goes to index.php
- Changes to permalink structure results in 404 error for all pages other than home
- I need a custom permalink for my website
- How to link to “most recent” document in the Media Library?
- Permalinks not working
- Problem with wordpress links on a live site
- Need Help Correct Regular Expression Redirect Code
- Why wordpress multisite root site showing blog prefix by force?
- Permalink change redirects by WordPress [duplicate]
- page nested 3 levels deep shows 404
- Removing /author/ slug from URL gives 404
- issue with setting up permalink programmatically
- changing permalink for custom template in posts of a certain category
- Force wordpress to display page with same url structure as categories
- Why the “Permalink” option is not showing in the “Settings”? [closed]
- is there a way to add the post URL to the results of fselect facet in Facetwp plugin?
- NGINX serve WordPress from sub-path fails with 404, how to fix?
- Redirect /%year%/%monthnum%/%day%/%postname% [closed]
- How to get the full URL of the current page and change domain of it?
- Custom permalink structure: /%custom-taxonomy%/%post-name%/ (without CPT slug)
- How to get functions.php work with postname permalink?
- How can I get this custom post type permalink structure? %custom_post_type%-%taxonomy%-%term-postname%
- Host frontpage via example.com and everything else via example.com/blog
- Dynamic Custom Permalinks
- 404 error using Meta for Permalink rewrite
- WordPress suddenly changed all links to example.com/example.com/
- How to handle paging/pagination with a custom permalink?
- Custom URL rewrites for templates
- “-2” Being added to end of URL (no duplicate pages, no pages in trash)
- Relative links in Gutenberg
- Why is my RSS feed not working?
- Convert single apix to dash in permalinks
- Page redirect to 404 when set Permalink = “Post Name”
- How to remove the link of an image on WP 4.2
- How to get raw unwritten querystring
- Is there a way to show attachment IDs on the attachment info screen?
- Keep permalinks in WordPress
- Can not manually change the permalink of a post in the EDIT secion
- How to change permalinks to show categoryname/post-name?
- Post with no tag permalink problem
- What permalinks do I use in the redirection
- WP Multisite Subdirectory Custom Permalinks 404
- WordPress’ «post name» setting broken
- Keep wordpress basic permalink preferences
- Permalink blog page (only) not working
- Link to a page before launch
- .htaccess to redirect to a wp page
- My WP homepage works, but the other pages don’t when accessing from out side of my network
- How do I use the same Tag slug for different Tags?
- Replacing + sign to – in wp Search Permalink
- Permalinks are not working in WordPress
- CPT links error: each one links to next one further along in the list
- Every sub page shows Error 404, i have check permalink but still same issues
- Permalink structure /page/page/cpt-post gives 404 with pagination
- Changing permalink structure for Posts
- Allowing slash in slug/permalinks
- Rewrite posts url as they’re all children of a page
- Author permalink
- Multiple Permalink Patterns for one page
- WordPress permalinks first word title
- I can get the permalink or the excerpt to work correctly, but not both
- WordPress permalink issue on AWS
- Permalink for Author’s Posts in a Category
- Permalink Rewrite with Archive – Archive gets 404
- WP Admin Bar not showing with custom permalink structure for pages
- Automatic -1 suffix being added to the permalinks of a page when the page does not exist
- Why doesn’t WP update my .htaccess file?
- WordPress permalink still not working (error or not understood?)
- Permalink for pages
- How is a URL getting mapped to a page template
- Getting the top level permalink using get_post_ancestors()
- What is the issue with our links? It creates a loop
- Routing ‘fake’ sub sub posts
- Page and post auto links
- how to make follow?
- Strip category base from URL?
- Does the error “A structure tag is required when using custom permalinks.” mean my permalinks haven’t saved?
- Add additional URL variations for a Post
- How to use ‘blogs.dir’ as media upload instead of ‘uploads’ directory in WordPress multisite setup
- How to make my custom permalink pull up the correct post
- How to Set Both Category and Sub-Category Level at Root. It should also obey post rule as /category/sample-post and /sub-catgeory/sample-post?