Skip Navigation

[Resolved] Post created with CRED form not displaying in archives

This thread is resolved. Here is a description of the problem and solution.

Problem:
Post created with CRED form not displaying in archives - How to set default value for specific custom field

Solution:
You can use the generic hidden field to pass the default value for your target custom field.

You can find the proposed solution in this case with the following reply:
=> https://toolset.com/forums/topic/post-created-with-cred-form-not-displaying-in-archives/#post-2055437

Relevant Documentation:
=> https://toolset.com/course-lesson/adding-generic-fields-to-forms/

This support ticket is created 2 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 11 replies, has 3 voices.

Last updated by attilaT 2 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#2048799

Tell us what you are trying to do?

I have a CRED form where users can submit new custom post. The submitted post is set to published, displaying on the frontend, but not listed in the archive page until I edit this custom post at the backend.

What is the link to your site?
cred form: hidden link
archive page: hidden link

#2049553

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

It seems like a cache issue. Editing the post from the backend flushes the cache and lets the archive return all the posts. Please check if this issue appears when:
- Only Toolset plugins are activated. It will tell us if there is an interaction issue with another plugin.
- The theme is set to a WordPress default like Twenty-Twenty. It will tell us if there is an interaction issue with your theme.
If the problem disappears, start activating one at a time to track where the incompatibility is produced.

If the issue persists, we'll need to migrate your website to our platform to make sure it is not a server-level cache issue.

Let me know what you will get.

#2049649

Hi!
Thanks for the reply!

I deactivated all other plugins, and changed back to default theme.
Tried again with different user roles too, but the issue persists.

#2050287

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Can I log in to your website, or preferably a staging site where the issue is reproduced, and check this further? Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

If I don't spot the cause of the issue, I'll need to migrate your website to our platform, is that ok with you? Do I have your approval?

#2050821

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

When I go here hidden link I get redirected to hidden link and then I can't progress whichever option I choose in the table.

Can you tell me where I can see the form?

#2050975

Sorry, my bad! This is the url of the form:
hidden link

url of archive:
hidden link

#2051543

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you for the credentials. The archive template is ordered by the custom field "Kiemelt edző", which means that it will display only posts that have a value for that field. Check this screenshot hidden link

I checked some posts and they had the default value for the post which is saved as 0 to the database. hidden link

So, I updated some posts, that have the default value, and I just saved them, then they appeared in the archive. So, I checked the form and there is a custom Javascript code that makes the field disabled. Check this screenshot hidden link

Can I ask the following:
- Do you need to set this field as disabled?
- Can you test the field with different values for it (use a different value than 0 for the default option)?

#2051701

I see, thank you!

In my case "kiemelt edző" field means featured partner.
I will have two forms: one for free and one for users who are willing to pay, to get the featured partner "Kiemelt edző" sign.
On the free form I want to disable the form and set to No ("nem") the "kiemelt edző" field.

I would like to have the archive page ordered by this field (kiemelt edző) to make sure the featured partners are on the top.

After reading your last response at the custom fields settings I changed:
- the values of the kiemelt edző field from 0 & 1 to 1 - ("nem" - this is default) and 2 - ("igen"),
- and in the settings of the free form, I changed the default value of the disabled field to 1.

But the post still not displaying in the archive after submitting.

#2054875

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Jamal is on vacation. This is Minesh here and I'll take care of this ticket. Hope this is OK.

When I checked all the posts of post type "edzo":
=> hidden link

I found that none of any post have "Kiemelt edző value set to 2.

So, I've edit one of the following post "Jóga Földvári Zsófival":
=> hidden link

And set the value for the field "Kiemelt edző to "Igen" that is 2.

Now, when I checked the archive on the frontend: hidden link
I can see the post "Jóga Földvári Zsófival" displayed at top - the first item.

Can you please check if its works as expected.

#2055287

Hi Minesh!
Thanks for jumping in!

So I realized the problem is, in the cred form I set the kiemelt edző field disabled (using jquery), as i dont want to let the user to change the value to 'Igen' (value=2). I thought the default value will be saved in the database, but its not happening.
In this form somehow I should pass the value=1 but without the option of changing it.
Can you help me with this?

(I will have an other form for premium users when they can change the value.)

#2055437

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

What if you try to add a generic hidden field as given under to your form:

[cred_generic_field type='hidden' field='wpcf-kiemelt-edzo']{
"persist":1,
"default":"1"
}
[/cred_generic_field]

And then try to create a new post, does it works as expected?

#2055621

Works perfectly. thank you guys!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.