Skip Navigation

[Resolved] Slug of new custom post

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 1 year, 2 months ago.

Assisted by: Waqar.

Author
Posts
#2646155

Hello,

On my site a user registers and can create a new pet memorial.
The heading of the custom post is the field [pets-name ] which is what I want.
The post is saved pending review and then I have to approve and publish it.
I want the url of post to be /pets-name. This usually should work by default with wordpress as it is the Page title/
The problem is when the user saves the draft the slug becomes something very long like /cred-auto-draft-2742fe1aa2b2615d435f5931c871fb53-3 isntead of the Pet name.
How can this be fixed.
I also use the Yoast seo plugin.

Thanks,

Jacques

#2646539

Hi Jacques,

Thank you for contacting us and I'd be happy to assist.

A simpler approach would be dropping a separate custom field 'pets-name' and using the WordPress post title for storing the pet's name too.

This way, the same name will be used as the post's slug too, like regular WordPress posts/pages.

Note: When a post is created through a front-end Toolset form and no page/post title is assigned to it, the automatically generated title is used ( in the format that you noted 'cred-auto-draft.....' ).

regards,
Waqar

#2647417

Hi Waqar,

Thanks for your reply.
Sorry but I am not sure what I have to do.
Could you please tell me in more details how I can assign a custom field to be the wordpress post title?

In the end what I need to achieve is to let the user set the wordpress title via front-end form.

Thanks,

Jacques

#2647497
post-title-field.png

Thanks for writing back.

> Could you please tell me in more details how I can assign a custom field to be the wordpress post title?

- My recommendation was actually not to use a custom field at all for the pet's name and only use the post title.

Here are the steps, that I'll recommend:

1. Please go to WP Admin -> Toolset -> Post Types and open the edit screen for the pet memorial custom post type.

2. Under 'Sections to display when editing', make sure that option for the 'Title' is checked.

3. In your form that adds a new pet memorial post, include the post title field, from under the 'Post Elements' section.
( example screenshot attached )

As a result, when users will use this title field for the name, it will be used for the post title as well as the URL/slug.

#2647531

Thanks a lot Waqar,

I was looking for post title, I shoudle have looked for "Pet title" : )