Missing permalink for custom post type
Make sure you have the option “Rewrite” set to True. It should solve the problem.
Make sure you have the option “Rewrite” set to True. It should solve the problem.
You’re passing 3 arguments to your function ($permalink, $post, $leavename), but you’re only specifying that it has 2 when you’re adding the filter (the last parameter to add_filter). Change your add_filter call to this: add_filter( ‘post_type_link’, ‘custom_post_type_link’, 10, 3 );
What is the setting of your permalinks under settings/permalinks? Have you tried using Custom Structure: /%category%/%postname%/ ?
Why does page for hierarchical taxonomy parent term go 404?
The answer lies in your question already… When you use get_permalink for your post 171, it gets you https://mysite/2018/11/24/152-revision-v1 So, as you can see, this post is not a published post, but a revision of a post. Revisions are not public, so you can’t see them… So how to solve that? You’ll have to check … Read more
To completely disable this feature, use this code, which I got from here. remove_action( ‘template_redirect’, ‘redirect_canonical’ ); To only disable it for URL addresses that contain the string ‘event’, use this code: add_filter( ‘redirect_canonical’, ‘disable_redirect_canonical_for_event’, 2, 10 ); function disable_redirect_canonical_for_event( $redirect_url, $requested_url ) { if ( strpos( $requested_url, ‘event’ ) !== false ) { return … Read more
you can use Custom Permalinks plugin. you can create and edit each post and category link very essay. https://wordpress.org/plugins/custom-permalinks/ Try this once
Your words say, you need to customize your web url. But the way (.something) is domain name or default web pages name. That’s why you need to use other character except (.)
Let’s take a look at get_blog_permalink: get_blog_permalink( $blog_id, $post_id ) { switch_to_blog( $blog_id ); $link = get_permalink( $post_id ); restore_current_blog(); return $link; } As you can see, there’s no magic… But there are some problems, since switch_to_blog isn’t very efficient… It means that it would be way better if you’d done it this way: $tp_blog_id … Read more
Create form or link with action=”my_media_update” <form action=”<?php echo admin_url(‘admin-post.php’); ?>” method=”post”> <input type=”hidden” name=”action” value=”my_media_update”> <input type=”submit” value=”Update Media Titles and ALT Text”> </form> Add this function and hook in your plugin file: public function kh_update_media_seo() { //update media files title and alt tags here // // at the end redirect to target page … Read more