Like I said, I can’t recreate the problem. When I add the post type and the users, etc, using your code and then I add field groups to the post type, when I log in as the user type I can see and edit the fields. I can only guess that there is something else going on with your site that is causing a compatibility issue. If you haven’t done so already you should open a support ticket. They may be able to help you better http://support.advancedcustomfields.com/new-ticket/
You’ve got a couple of things going on here, but I think it should be
echo (get_field('7_day_rate')/7);
I think you may have missed my other question. It’s the only other thing I can think of that could be causing your problem.
What are the location rules on the field groups you have on this post type?
I don’t know the answer to that. I can’t get it to happen even if I set up a field with two templates the way you had it set up. But, it seems your problem is corrected.
I’ve tried the setup you describe.
The thing is that this field group should not be showing up anywhere because the page template cannot be both templates. Your locations rules should be OR rather than AND.
So the next question is, do you have any other field groups that include a WYSIWYG editor?
If not, what other plugins or acf add ons do you have installed on the site? Does the problem go away if you deactivate them?
I’ve set up a similar situation on a test site and I’m not seeing the behavior you’re seeing.
With your post type set up and your user roles
When I log in as one of the user types I cannot edit the post type at all, it does not appear in the admin menu.
When I log in as the other user type I can edit the post type and any ACF field groups that I add to that post type are visible and I can edit them
Sorry, I don’t remember which role is which
What are the location rules on the field groups you have on this post type?
I partly agree. A default name is added when the label field looses focus or the name field gains focus, unless you’re experiencing a javascript error. In order to save a field without a name you must delete it on purpose and then not enter a new one.
I’ll mark this topic for the developer to take a look at.
Try this
function my_relationship_result($title, $post, $field, $post_id) {
$args = array(
'fields' => 'names'
);
$terms = wp_get_post_terms($post->ID, 'area', $args);
if ($terms) {
$title .= ' ['.implode(', ', $terms).']';
}
return $title;
}
add_filter('acf/fields/relationship/result', 'my_relationship_result', 10, 4);
The code that I posted will work if you supply your custom taxonomy slug in this line
$terms = get_post_terms($post->ID, 'your-taxonomy-slug', $args);
I’m not associated with the support ticket system. I just know that it’s a more direct route to the developer or those that can better help with direct support. Unfortunately, since I cannot recreate the problem that you’re having I can’t really help you. There really isn’t anything in the function you posted above that should keep a taxonomy field from saving on a front end acf_form.
My code is missing a semicolon at the end of the last line. I edited it.
But you’ve still got me confused.
Basically i want the relationship field to show the post name as well as the custom tax its assigned too.
Do you mean the terms assigned? The custom tax that’s assigned does not make much sense.
Also you will still need to edit my code to provide the slug for you custom taxonomy, that’s if you are looking to show the “TERMS” of the post.
I think (but it’s only a guess) that the problem is $_GET[‘tag_ID’] is a string value and WP might require this to be a number. Try
$args['category__in'] = intval($_GET['tag_ID']);
You’re question is a little confusing for me. Do you mean that you want to show the terms in a custom taxonomy that the poas is assigned to? If it is, what is the slug for the custom taxonomy?
Doing this would look something like
function my_relationship_result( $result, $object, $field, $post ) {
// get post terms
$args = array(
'fields' => 'names'
);
$terms = get_post_terms($post->ID, 'your-taxonomy-slug', $args);
if ($terms) {
$result .= '[' . implode(', ', $terms) . ']';
}
return $result;
}
// filter for every field
add_filter('acf/fields/relationship/result', 'my_relationship_result', 10, 4);
The standard ACF shortcodes are only meant for simple fields. If you set the image field to return the URL you could use a shortcode like
<img srd='[acf field="free_transportation_banner"]' />
To use more complicated return values in shortcodes you’d need to write your own shortcode functions.
If you use the standard registration form for WP that is displayed if you set your site so that anyone can register and you add a field group to user forms all then the fields will be shown when on the registration form.
As far as not doing any coding goes, ACF is not really meant for people that want to avoid coding. Something you might want to consider.
Your comment about the custom post type not supporting more than one category confuses me. What you’re trying to do would be best done using a custom taxonomy that’s attached to your custom post type. http://codex.wordpress.org/Function_Reference/register_taxonomy. Using a custom taxonomy would give you a way to have pages bases on each term easily.
To do it using a custom field you’ll need to create templates for each of the “Tags” and do a custom WP_Query for each. For more information on querying posts based on custom fields see this how to: http://www.advancedcustomfields.com/resources/query-posts-custom-fields/
I can mark this for the developer to take a look at.
You might try submitting a support ticket on this. This is basically a user forum.
http://support.advancedcustomfields.com/new-ticket/
You might want to try reinstalling. Deactivating other plugins. Switching themes. I’m not seeing this type of error on my test site. If the problem persists you may want to submit a new support ticket http://support.advancedcustomfields.com/new-ticket/
I’ll mark this for the developer’s attention.
It’s not really possible with ACF without doing an quite a bit of work. I suppose you could create a true false field called “dulicated” or something like that, then create a pre_save_post filter and test if that field is checked. If it is then create a new post by copying the values and returning the new post ID from your filter.
This is the plugin I use for duplicating posts, but it does not work on the front end. https://wordpress.org/plugins/duplicate-post/
@noahkuhn, what version of ACF are you using?
I posted in the bug report topic posted by @drunkrocketeer http://support.advancedcustomfields.com/forums/topic/acf-returning-id-as-string-instead-of-an-array/. I am not seeing this on my test site with 5.3.2.2 (latest version). But I have not tested with ACF4.
As @UKF says, yes, it’s possible.
Create a radio field with the first 3 choices and then make the remaining fields conditional based on the radio field.
5.3.2 completed the addition of built in functionality for repeater fields. Not sure how this is going to affect the repeater collapser plugin.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.