As of WordPress 4.5 you can use:
get_post_type_archive_link( 'post' );
This handles the logic of getting the correct URL regardless of whether posts show up on the homepage or in a specified page.
Related Posts:
- Mamp pro permalink issues. Pages keep reverting to index.php
- Using classes instead of global functions in functions.php
- How to set permalink structure via functions.php
- What is the difference between wp_register_sidebar_widget and register_widget?
- Change admin bar to default:off
- Create “File-less” Page Template in Functions.php
- Different ways to display title
- How Do I Programmatically Force Custom Permalinks with My Theme?
- When to use esc_url, esc_html, esc_attr, and friends?
- How to edit bbPress template files – WordPress + BuddyPress + bbPress? [closed]
- How to change post thumbnail title and alt attributes to post title?
- Why might $input (Settings API) be coming through empty?
- Override default cropping in WordPress [duplicate]
- Get password when user registers and save it sha1 into database
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- Removing the default sidebar from admin panel
- Merging PHP download script into `functions.php`
- Is there an error in get_the_tag_list()?
- Returning Variables back into a template
- Allow users to add custom functions to wordpress theme
- Change date number to another language/script?
- How to add custom template tag in wordpress theme?
- Nesting Functions within Functions
- Is using eval() ok in this scenario
- Custom php page in WordPress theme?
- Can’t access WordPress functions in file called via Ajax?
- How can I customize wp_footer, where is the code that controls what this function does?
- How to list all images in uploads directory except those that are attached to any post
- More than one meta field in a single meta box?
- Is there a theme function for is_password_protected()?
- how do you create an admin interface in plugin for your theme
- Link won’t show using the_permalink();
- How to determine which custom header image is being shown
- get_query_var() and permalinks
- Toggle Sidebar Display
- How to store functions in… functions.php?
- Unhook jQuery from WooCommerce via `functions.php`? [closed]
- trying to use wp_handle_upload with ajax
- Should I use include or load_template for including shortcodes, plugins and so on?
- Check if home.php and set home.php as page_on_front
- WordPress custom post type permalink: website.com/post-name/post-id
- Should I use add_filter for functions in function.php of the theme?
- after renaming my wp-content folder, how do I upgrade my wordpress version?
- Pass variable to hook. Its possible?
- Filter categories used with Custom Structure Permalink
- How to make permalinks update from code?
- Theme Customizer not loading JS for live preview
- Remove “You are using WordPress 3.2.1” from Right Now Dashboard Widget
- Default Permalink Type to Postname
- Replace function in a child theme
- How to set a page as homepage in stead of the newspages?
- Custom theme, contact form 7 & fast secure form doesn’t work
- Change the “Default Avatar” admin option via functions.php
- Replace single_template filter with what for default posts?
- wordpress 404 not found after rewrtie the author link
- Issue On Displaying Pages with Post Name Permalink
- Issue on Getting Custom post type Thumbnail’s URL
- WordPress page/blog incorporated into static website
- JQuery undefined and Stylesheet loads in bottom along with js files
- How to call the_time current?
- Only the latest post shows up on post page?
- Add content after get_header
- Can’t change theme name
- How to set default values for edit_post_link() in my theme?
- How to remove permalinks links presents in each page of my site?
- How to make excerpt image be full size instead of thumbnail?
- If I remove Category base from my URLs, how difficult will rollback be?
- What are the permalinks options for “Category” base and removing it?
- How do I open a post in a custom page in wordpress?
- Does single webpage do not need navigation to create a slug in permalink?
- Getting post URL within custom content template
- WordPress permalink setting
- enqueue script if page is not equal to
- apply_filters to featured image
- loading custom.js file after jquery is loaded
- Permalinks problem with custom theme
- Creating custom function in wordpress to return data from database
- Getting URL of Resized Image
- Adding a new layout for genesis
- themeforce (happytables framework) implementation
- Permalink Setting Changes From Post Name to Default After Changing The Page Name
- Configuring static page with add_rewrite_rule gives 404 after navigating to Permalinks admin panel
- How To Add New Option Types To Option Tree?
- Comment form not display properly?
- How to add menu support to a theme?
- Moving functionality from functions.php to classes?
- Gutenberg Reusable Block as part of WordPress Theme page
- Prevent theme from activating [duplicate]
- Single Page Design, Storing in Theme Options
- Scroll to position on page for category pages only — woocommerce
- How do I get the trackback count of a post in wordpress without writing an SQL query?
- Call to require(‘../../../wp-blog-header.php’) results in 404 error?
- Theme not calling Jquery properly
- How to add menù section to my WordPress template?
- tag__in does not return posts
- wanted to sort the wp_query array by two ACF field (Year and month)
- Testing localhost WordPress site over LAN with iPad, iPhone
- Reliable method to detect mobiles
- Using require_once for parent-directory not working but is working in sub-directories
- WordPress get number of categories