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
- How to Check if a Page Exists by URL?
- Use category base slug in posts’ permalink
- has_archive=false on the default post type
- Clear cache when a post is submitted [closed]
- How to automatically generate a unique random slug
- Custom permalink structure only for default posts
- Post slugs and images cannot have same name?
- Change permalinks for post type ‘post’ only
- Change the Slug of Post Type post to baseurl/post/%postname%
- Different permalink for posts and authors
- Pretty URL with add_query_var
- get_permalink returns default link
- Group Posts by First Letter of Title
- Create an “All Posts” or “Archives” Page with WordPress 3.0?
- Post Format Archive template name for theme folder?
- Keep getting same permalink with WP_Query?
- How to control which category will be picked for the slug of a post?
- how to get permalink using sql
- Change slug with custom field
- widget should display post archive by year and on click also by month
- Why can posts never have a number as the link?
- At my posts archive page, outside the loop, get_the_id() returns the top most post’s ID
- Display most recent post in category instead of archive?
- How to allow slashes in single posts when i click in the edit permalink button
- Single.php Active Category Class
- Post custom permalink results in 404 for archive page
- Some posts returning 404 instead of displaying post
- Custom post type single (permalink) throws a 404 error
- Post in Multiple Categories to stay in current category (permalink, next previous post link)
- get_post_type_archive_link(‘post’) returns current category archive
- Random post permalink
- What Defines What Category A Post Picks (if in multiple)
- How to get the latest posting time of archived pages in WordPress?
- get_permalink executes link without https
- Permalink Settings: optional settings doesn’t apply to editor
- Custom post type permalinks breaking due to 3.1 bug fix
- How can a guest view the “Pending Review” Post?
- Create pretty permalink for a post knowing the permalink structure
- Changing my permalink structure – will new layout conflict with existing page?
- How to change the page break URL from ../post/2 to …/post/page2/
- Link post permalinks to subdirectory /post
- Remove permalink from images when inserting into post
- Display all months with posts and inside each month show the 5 latest posts
- Display posts from #6 to #20 on archive page
- Remove the Edit button in posts for permalinks on certain user roles? WP 3.3
- Dynamically generate child-URLs for posts or custom posts
- Bulk update post slugs through database
- Category List (Archive) Page Template By Category
- Getting category posts from a certain year
- Adding parent pages to posts
- Plain permalinks not working!
- Yearly archive page for future year
- Which URL to enter into browser to show all posts in archive.php?
- How to display data in archive page?
- Guest Author – How to display posts on /author/ archive page
- Removing rel=”nofollow” from links posted in Post Content
- 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?
- Move first half of posts to one parent page, second half to the other page
- How to check a post exist when the permalink has post id in it?
- Archiving by academic year instead of calendar year
- After database migration, posts not showing up in dashboard
- List category posts alphabetically on archive.php
- How to do set post permalinks using 6 digit random unique function?
- Switch to page template when using post permalink
- Trying to use AngularJS with WordPress without any API
- How to handle broken links created by permalink/slug changes?
- How could I change my Permalink from blog to custom structure? [closed]
- Visting slug for ‘post’ post type shows 404 not archive?
- Any way for get_next_post() to use the actual post order instead of publish order?
- how do i add posts-page slug before posts slug in permalinks
- Permalink doesn’t get displayed in Twitter button (Local WordPress problem?)
- How to display excerpt post on hamepage and archive pages?
- Retrieve post ID from “querying” URL
- Increase 10 post limit per page
- hiding permalink in admin if the user is subscriber
- Why does WP_Post not contain its permalink?
- the_permalink() not working in a root installation
- 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
- Second get_permalink inside loop points to wrong URL
- Custom Post Type archive
- Custom Permalink Structure for Pages & Posts
- custom word in custom permalink structure
- Does WP automatically tag posts into the archive?
- singular posts using archive styling
- register_post_type permalink
- Updating permalink structure using ‘post_link’ filter results in 404 error for posts