There are two hooks named 'pre_post_link'
and 'post_link'
. Their first argument – which you can change – is the permalink. So …
add_filter( 'pre_post_link', 'wpse_42406_change_permalink', 10, 2 );
function wpse_42406_change_permalink( $permalink, $post )
{
// change the permalink, let it point to an archive etc.
return $permalink;
}
… will change the output.
In your loop you probably use something like …
<li id="post-<?php the_ID(); ?>">
Your permalink could then point to the archive page of your choice plus #post-$post->ID
. For example:
http://example.com/2012/04/#post-42
Related Posts:
- Link for the page archive for posts, like using custom post types with get_post_type_archive_link
- change default post archive page link
- Permalink Short code showing unnecessary link text inside the loop
- Prevent Archive URLs
- My posts section for logged in user
- Where is the old post permalink slug stored?
- Difference between an archive and a page listing posts
- Post slugs and images cannot have same name?
- Pretty URL with add_query_var
- get_permalink returns default link
- Create an “All Posts” or “Archives” Page with WordPress 3.0?
- how to get permalink using sql
- Why can posts never have a number as the link?
- How to allow slashes in single posts when i click in the edit permalink button
- Post custom permalink results in 404 for archive page
- Custom post type single (permalink) throws a 404 error
- get_post_type_archive_link(‘post’) returns current category archive
- What Defines What Category A Post Picks (if in multiple)
- Custom post type permalinks breaking due to 3.1 bug fix
- How can a guest view the “Pending Review” Post?
- Changing my permalink structure – will new layout conflict with existing page?
- Display all months with posts and inside each month show the 5 latest posts
- Yearly archive page for future year
- Which URL to enter into browser to show all posts in archive.php?
- How to change permalink on post click on post listing page
- Changing Permalinks for Default Post type to reflect navigation
- How should I add links to other pages/posts from my post?
- WordPress not opening posts with only numbers if permalink is post_name
- Using permalinks, category slugs, and tag slugs
- Problem with permalink routing?
- After database migration, posts not showing up in dashboard
- List category posts alphabetically on archive.php
- Switch to page template when using post permalink
- How to handle broken links created by permalink/slug changes?
- Visting slug for ‘post’ post type shows 404 not archive?
- Retrieve post ID from “querying” URL
- Increase 10 post limit per page
- hiding permalink in admin if the user is subscriber
- Automatically create a new page daily with last three posts
- When changing pages to posts, how do you set up 301 redirects for the page URLs?
- Archiving posts in wordpress
- Custom Post Type archive
- custom word in custom permalink structure
- Does WP automatically tag posts into the archive?
- Updating permalink structure using ‘post_link’ filter results in 404 error for posts
- Custom permalink for each post
- I want to show my post for limited time, how is it possible?
- How to edit the ‘
- When WP_Query only returns 1 post, how do I automatically redirect to that post?
- Post-Archive like a page in a specific subdirectory
- adding my posts (author posts) in menu
- Archieve page, Advertisement Every 3 Posts
- Highlighting Current Category in the Archive and Feeds page
- Standalone form does not post to the url when form fields are populated (otherwise it does)
- Changing permalink of WordPress
- Set Default Post as Parent Child (Nested) Relation
- How can I add random alphabets in wordpress permalink posts structure
- Change permalinks for posts & for custom post types
- My post permalinks are redirecting to the post archive page for some reason?
- How can I make a post sub link?
- How do you change the permalink for posts for a single category?
- Posts are not displaying on their category and tag page
- How to set the post permalink using the WordPress REST API?
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- WP posts using index.php instead of single.php
- unable to display two post per page in wordpress front-page.php
- How to 301 redirect from url with post id to permalink with post name (slug)?
- show image gallery in archives or category page
- Custom Post Types and Broken Permalinks
- Get posts from category from custom query
- Permalink structure for two seperate blogs
- My post permalinks are always the same
- How do I apply a wordpress function to something with no ID inside an archive page?
- Permalink base only for posts
- Precedence of page permalinks over woocommerce product category links?
- Fixing the WP Post Object for Custom Route
- post_name is not stored until post is published… where should I store my slug until it goes live then?
- All my posts don’t show, only the headline is displayed on the homepage
- Disable archiving of old posts?
- How to change post template via url?
- is_archive() not working on selected “Posts page”
- Use a custom post URL that is outside the blog root directory
- Change link to permalink inside post content
- How to organise post by category and date
- Daily posts like an archive
- TCPDF and permalinks
- How do I display the next 3 posts in the sidebar?
- WordPress sub-posts and permalinks
- How to display subcategory articles in the category view?
- Change posts URL [duplicate]
- Show all posts in category
- custom sort posts in archive/taxanomy page
- How can we pass a value from the_permalink() at WordPress?
- Add author section on Author archive posts
- Default post type doesn’t display in url
- How to change Permalinks only for Blogposts
- Permalink structure for two separate blogs
- Blog posts are not appearing as subs of Blog Page
- How to add paraent in Blog post URL in wordpress
- Change permalinks in posts via SQL