get_post_type_archive_link()
doesn’t return a link for the post type post
, because technically it has no archive registered on registration of the post type. You can check this, if you inspect the output of get_post_type_object( 'post' )
. So actually get_post_type_archive_link( 'post' )
will return false
– see source.
You can get the link for the page for the posts another way:
$permalink = get_permalink( get_option( 'page_for_posts' ) );
Related Posts:
- Display most recent post in category instead of archive?
- Single.php Active Category Class
- Category List (Archive) Page Template By Category
- singular posts using archive styling
- Post-Archive like a page in a specific subdirectory
- How to view all posts (on site, not admin) that are uncategorized?
- Highlighting Current Category in the Archive and Feeds page
- Posts are not displaying on their category and tag page
- show image gallery in archives or category page
- Get posts from category from custom query
- How to organise post by category and date
- How to set a link to custom archieve page
- How to get pagination working with “Pending” Posts
- Show all posts in category
- how to show all post with its contents
- How to show related posts by category
- Including categories in search results
- Count how many posts in category
- Custom Single Post By Category
- Convert custom fields to post categories
- Query posts from current year
- Show One Category on Post
- Display all posts under child sub category in sidebar on post page?
- How do I get the slug of a custom taxonomy category of a post?
- Featured Posts for Category Pages
- Authors in menu, template list post by author
- change default post archive page link
- Count to how many categories a post belongs to
- How can I remove posts of a certain category from homepage after a specified time period?
- Edit custom post type admin menu link
- How to display WordPress archive into three columns [closed]
- Which URL to enter into browser to show all posts in archive.php?
- Get mixed category random posts
- Using wp_list_categories like the the_category (showing just current categories of a post)
- Should I use posts or pages in this scenario?
- Stop users posting into category while still seeing contents of the category
- How to allow users to post only in certain category and hide elements from edit page?
- Need help with category listing!
- Prepending %category% onto default posts fails
- List all categories with featured image from post?
- Increase 10 post limit per page
- How to make the first post in the loop be styled like a “new / featured” post?
- Automatically create a new page daily with last three posts
- Archiving posts in wordpress
- How to display two random-post sections that are each under their own category
- How can you display all sibling categories to a post?
- Category page when using static front page
- How to create a “latest news” page showing a list of posts from blog category
- how to hide empty fields of post category description?
- Change Post Title For Specific Category
- How to have more than one page for your posts if you have 8 posts but can store max 4 on a page
- Extract wordpress posts content and category content
- All categories displays the same posts
- Having pages after specifying post_type post
- I want to show my post for limited time, how is it possible?
- Get latest post from categories
- How to create a playlist for audio associated with posts per category
- How to edit the ‘
- How to show a featured image inside a post in only 1 single category
- Display Parent Category of a Post belonging only to Subcategory
- Get current taxonomy and display query accordingly
- Geting error in post and category [closed]
- Display most recent posts in category with Twenty Ten theme widget
- Display a specific category in a focused area of my site
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- How to 301 redirect from url with post id to permalink with post name (slug)?
- Create/Set Category as Title of Post
- How to distinguish pages created by woocommerce?
- How to display related post from same category in single.php
- Save All Post Permalink From A Specific Category into a .txt file
- Page with Category Returning 1
- get current index of post content in category page
- Get 5 most recent categories
- Dynamically load posts based on category
- Get Categories & Posts With Type Article
- How do I apply a wordpress function to something with no ID inside an archive page?
- Set multi posts random categories and tags
- Add new post only in assigned category
- Changing the Category for all posts of an Author
- Admin Post List Only Show One Category
- Add category attribute to custom recent post shortcode
- Same sidebar in all posts as in the category
- How do I list categories and the common categories for posts beneath those categories?
- Latest Posts not in the right order
- Daily posts like an archive
- Retrieve latest post by multiple categories with ID
- How to Include a common category in a custom Category Search
- How to display only one post on first category page and rest on next pages?
- each user having category with their name and can add sub categories post in that category
- Viewing category won’t show up Custom post type posts
- custom sort posts in archive/taxanomy page
- exclude certain categories from posts
- Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]
- Listing category and its posts one by one
- Print out one of 2 post category [closed]
- How to get if category has posts?
- Show some texts in posts belonging to Specific category
- Sort Posts Alphabetically Based on Specific Category (Divi)
- I have a website issue I am trying to resolve
- How to sort posts alphabetically based on a specific parent category