Just got a solution: Just add this code to your functions.php and replace ‘_metainfo’ by your meta information and ‘posttype’ by your posttype.
function add_meta2url( $link, $post ) {
$post_meta = get_post_meta( $post->ID, '_metainfo', true );
if ( 'posttype' == get_post_type( $post ) ) {
$link = $link . '#' .$post_meta;
return $link;
}
}
add_filter( 'post_type_link', 'add_meta2url', 1, 2 );
Unfortunately, the ‘#’ cannot be replaced by any other special character like ‘-‘, otherwise the url is responding with a 404 error message.
Related Posts:
- meta tags doesnt fetch data from permalinks
- Create Custom URL structure for specific Post category using Post ID instead of post name
- Custom route and extract data from slashes and parameter
- reWrite wp-content url to point on my cdn
- Add #primary at the end of navlink permalinks on single posts
- What’s the difference between home_url() and site_url()
- Prevent “main” WPMU site_url() being returned in functions
- Custom page with variables in url. Nice url with add_rewrite_rule
- Relative URLs and hide /wp-content/themes/
- Is it possible to use a forgot password url filter?
- Create Custom URL structure for specific Post category
- Add options to featured image
- How do you permanently remove default rewrite rules from the wp_options table?
- Change meta tags programatically
- Use a function to update post meta based on other post meta
- update_post_meta for custom field not working upon form submission
- How can I rename the WordPress AJAX URL? [duplicate]
- Assign category using custom field?
- Convert User ID’s to User Names in a single.php file
- How can I create a page with a specific URL?
- Ninja form Redirect depending on text field content [closed]
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- Move Post to different category if post_meta field is 0 or is 2 days old?
- How to rewrite the custom url in wordpress?
- wp-comment author- url +, email filter hook
- What WordPress function to use to get meta value by using meta keys?
- Removing custom meta data
- WordPress on AWS Auto scaling and ELB giving 503
- WordPress converts media extention URL automatically to video player
- Default Custom Field Value Automatically Update
- Post meta not updating
- Function to update post_meta based on existing post_meta
- Exclude from the query posts with meta_key and meta_value
- Get arguments from URL
- Prevent custom field from being updated after first publish
- Get array of metakey in all posts
- User function to return multiple get_post_meta()
- Add unique id to Preview URL
- Page get parameter doesn’t work with is_single() function
- What are the meta fields for an attachment?
- How to rewrite wordpress search to work on specific category
- How can I set the SRC URL of the custom logo image?
- Need to convert image url to a Base_64 data url with wordpress function..
- How to Add Shortcode to html img code?
- Protect get_query_var from manual input in url
- Problem with images URL after filter applying
- Rewrite Question Mark in Post Template with URL Parameter for clean URLs
- How i can get the URL?
- include w_thumbnail_src in function?
- How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes ‘&’ to ‘#038;’?
- How to avoid saving empty data to sql while using add_meta_box
- How to change text color depending on the number value (Using javascript)
- Fetch URL parameter
- how can I change all wordpress media file url to custom cdn url?
- How to add custom metakey to shop_order page’s searching function?
- How to Override Page Template if URL matches query?
- Update wp_postmeta table based on 2 keys
- blank page with wp_get_attachment
- Set URL Parameter Post Layout As Default
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- How to change form action of wp-login page with a function
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- Creating a “Related Meta” type field?
- Route wordpress with template
- Remove post from latest posts after a month only with certain tag
- save_post doesn’t correctly process function call with php class
- Rewrite rules and the permalink
- Edit meta fields from within template
- Using Switch Statement to Change Image According to Last Digit of Topic ID
- Return ACF Field value function
- Instead of using $post, how do i get the thumbnail image of the $post
- Problem with add_rewrite_tag
- update_post_meta not working in function
- How To Get WordPress Categories Last Update Date?
- Automatically add custom fields (post_meta) to all published posts, hourly, via wp_cron?
- How do I change the URL returned by next_posts_link()?
- Function in functions.php by url
- update_post_meta after form is submited
- Add custom fields after post/page title
- Remove base from the custom post type URL [duplicate]
- Display post_meta-by_key on product catalogue
- How to save custom made object in an array in a post meta field
- Adding and updating repeating custom field meta data
- Please give me the rewrite rules for my ugly urls
- WordPress is adding pagination for all pages not only for blog page, How to remove pagination for all pages except blog/posts page?
- Possible to search by author name with default WordPress search function?
- When new user register then add new user role
- Set first oembed in post to a global variable or function
- PHP files included in functions.php don’t seem to work
- WordPress shortcode attributes for database SELECT?
- Help with Rewrite Rule for Custom Post Type with Query String
- Creating A New Admin Menu Tab For Theme Options
- ngnix Url rewrite doesn’t work
- Function extending with if query in functions.php
- What is wrong with code added to functions.php to selectively show styles based on login state
- functions.php return custom text
- WordPress Categories: Function using custom SQL to return array of specific category IDs
- Frontend Feature image upload not work
- Will my WordPress site become vulnerable after adding this functions which allows more HTML tags for subscribers?
- Comment turned Invisible