Post Title Not Saving Correct Slug
-
Hi. Why was the ACF field option removed for the title? Setting the default title as post title, the Title Label refuses to change and still doesn’t work anyway. I see an option in the backend of ACF that allows you to set a custom field as the post title which I assume is an option added by this plugin, but although it saves the title, it doesn’t save that title as the slug, it’s saving a random post number, e.g. example.com/27583
Am I missing something?
-
The Title Label not changing was a visual bug, had to delete and re-add the widget to get it to work properly. Also, after updating, all the post labels disappeared and you have to disable and re-enable the Post Labels option in the widget to get them to show.
But the major issue of the custom post type slugs remains. After updating, the post title field is blank because the custom ACF option is gone. As I mentioned, setting it to None/Custom and enabling ‘Set as Post Title’ on a custom field in the ACF field group options saves the title correctly but the slug is saving as a post ID/number. On the Edit forms for the same post type, the title and slug do update correctly so it’s only when adding New custom post types.
I know there’s the option to use the default title and rename it which would be helpful but that option isn’t saving either a title or a slug at all. Maybe there’s conflicts with other plugins but for now I’ve had to revert back to version 2.3.6
Hello @windurin. I hope all is well. I meant to put out a video tutorial about the new way of replacing the default title field, but it got delayed, unfortunately.
I apologize for the complications this caused you. Unfortunately, there were some bugs that passed testing, which is why the new way to add a custom ACF field didn’t work.
Hi Shabti. But what I’m saying is I can’t get it to work, even with the latest update. So can you explain the process here please? If you want to use a custom field as the title, I assume you enable the ‘Set as Post Title’ option for that field, then choose None/Custom in the ACF form widget. That’s what I’ve tried but why then is it saving new custom post type slugs as IDs and not the post name? It’s nothing to do with the permalinks settings because editing and updating the post does then save the slug correctly, but a NEW post saves it as an ID/number.
@windurin it turns out that this wasnt updated. But I just pushed up another update that takes care of this
FYI, the readme.txt file still says:
Stable tag: 2.3.15Thanks π Ill change it
Were you able to update?
Yeah, I’ve updated the plugin but won’t have a chance to play around until later on this evening. I’ll report back once I have tested π
Hi Shabti. Thanks, it’s working now after that latest update. I thought I was going crazy and I would have to disable a load of plugins to find a conflict ha.
Thanks for updating it so quick.
@hshah is this happening on the “new post” action?
In the “edit post” action, the slug should remain the same, although we are going to add an option to let you change the slug when updating.
@hshah That is the problem I was having with 2.3.15, but 2.3.16 fixed it. I did have to re-add and set up the form though. I assume you also have ‘Set as Post Title’ enabled on a certain text field in ACF?
I’ve recreated it a few times but don’t seem to be having much luck. I wouldn’t be surprised if I am doing something silly here though, so I’ll quickly run through what I have set up.
ACF Field Group
# Title (Text Field, Required, Frontend Only, Set as Post Title)
# Description (Text Area, Required, Frontend Only, Set as Post Content)
# Attachments (Gallery, Required)ACF Form:
# Action = New Post
# Fields = Field Groups (selected the group detailed above)
# Post Fields = All set to None/CustomI have set it to redirect to new post URL, so when I save the form, it takes me to:
https://website.co.uk/photos/11331-2/?updated=5c8e336_11312I’ve just noticed that if I try to edit the post from the admin backend, the URL is:
https://website.co.uk/wp-admin/post.php?post=11331&action=editEvery single test post I have tried to create has the slug as:
postid-2If I try and access the post using:
https://website.co.uk/photos/11331/It just goes to:
https://website.co.uk/photos/11331-2/Are you definitely using 2.3.16 (or even 2.3.17 now) and not 2.3.15? Because your setup is exactly the same as mine and it started working from 2.3.16 onwards.
@hshah that’s really strange bahavior.
Could it be a permalinks issue? Was this working the way you want before 2.3.15?
The topic ‘Post Title Not Saving Correct Slug’ is closed to new replies.