Hi @Jacob311
I mean no offense, but I am slightly confused that you don’t know what I mean by ‘debugging’ a function.
The code you are writing is extremely custom and far from a one click install approach. Perhaps you need to hire a developer to look at this issue?
Also, please read the docs thoroughly if you don’t understand what the $options do.
Again, I am not meaning to sound rude, however, this is a developer plugin and it is a pre-requisite that you are a confident PHP developer before using it, especially creating a front end form.
If you have any specific questions, don’t hesitate to ask.
Thanks
E
Hi @tebbott
Using the strtotime function should work like this:
<?php
$date = get_field('date');
// $date = 19881123 (23/11/1988)
// extract Y,M,D
$y = substr($date, 0, 4);
$m = substr($date, 4, 2);
$d = substr($date, 6, 2);
// create UNIX
$time = strtotime("{$d}-{$m}-{$y}");
// format date
echo date('d/m/Y', $time);
?>
Good luck!
Cheers
E
Hi @soulhuntre
Thanks for the question. Unfortunately, I don’t have the answer to this one.
I think this is just an issue that is un avoidable.
Thanks
E
Hi @Jake Love
Perhaps the quickest way to find the issue source is to create a fresh install of WP with ACF.
Create your field group and test with the admin user.
Now install you user role manager plugin and test with the new user role.
Does the issue persist?
Hi @dallen
Currently, there is no exporter for the options. However, it would be quite easy to run some SQL to select all data from the wp_options table where the option_name starts with ‘options_’
Cheers
E
Hi @bradwiatr
Please first read these 2 articles:
* http://www.advancedcustomfields.com/resources/getting-started/including-lite-mode-in-a-plugin-theme/
* http://www.advancedcustomfields.com/terms-conditions/
Currently, you can only package the options page and gallery add-ons. The repeater and flexible content field add-ons will soon receive an update with the remove-able updater script.
A simple message in your readme.txt file will be suffice.
Thanks
E
I did not use the Post Types Order, but put the function from kakaroto84 in my functions.php.
Now my code looks like this:
<?php
$child_pages = get_field('child_pages');
objectRSort($child_pages, 'menu_order');
if( $child_pages ): ?>
<ul class="subpages">
<?php foreach( $child_pages as $post): ?>
<?php setup_postdata($post); ?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php endforeach; ?>
</ul>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
Thank you kakaroto84!
Thank you for the reply elliot. Can you tell me how to “debug the acf_form_head function”? Also, I don’t understand how to use the $options array. I didn’t know if when they said to “just use this snippet” if that meant to use it as a template and fill in my own stuff in certain areas, or what.
I’ve disabled all my plugins and reverted to a fresh Twenty Thirteen and I still can’t get my frontend form to work. I can see an Add Image button and Update button but the update is not working. I’m not saving the data.
I know the backend works because I assigned this image upload field to the dashboard page of “school-logo” and when an image is loaded through that, it displays just right on my site using <img src="<?php the_field('school_logo_image'); ?>" />
I need to be able to move many of theme options to the frontend of the site so any information is great.
I’m afraid you understood the issue better than you thought 😉 This was definitely the problem.
Sry for not being more clear in my description.
And thanks for a lovely plug-in; when I realized that one could use repeaters within repeaters I was so thrilled!
@eliot thank for your quick reply
sorry for the delay.
I had deleted my jquerycode and had to create a new one.
here is my jquery code http://pastebin.com/JukGMBm2
what does not work is the selected option
Elliot,
I’m using the select field with “allow null” set to yes. With the select box left on “- Select -” it still saves a value of “null” to the custom field. This leads to a bunch of custom fields like this:
It appears this just isn’t with null values, as ACF creates blank custom fields also (see the “link” custom field above).
Hi @elliot,
When I submit a form on front end and the validation turns up error, the message is: Validation Failed. One or more fields below are required.
How would you suggest I alter that?
Hi @sirjonathan
Thanks for the debug info. It’s quite a bit to take in, but I think I’m following it.
Off the top of my head, I’m not quite sure why this issue would happen, but I do know that WPEngine and ACF have some pretty major caching issues which may explain why the value did not come back as expected..
I’ll keep it in mind in future work.
Thanks
E
Hi @popmouth
Sorry, I don’t quite understand the issue.
Is the field type in question a ‘number’ field? If so, perhaps you will need to change this to a text field to allow for non numeric characters
Hi @erni41
To answer your second question, please use a text field for any URL data.
For your first, I don’t belivee I have yet read the email but can you check that the global $post->ID value is that of the correct post? Perhaps ACF is loading data from the wrong post?
Thanks
E
Hi @tigerfish
Looks like you need to add in a meta_query arg to the query.
To get you started, please read the guide for filtering posts:
http://www.advancedcustomfields.com/resources/how-to/how-to-query-posts-filtered-by-custom-field-values/
After you have read and understand the above, please have a search around for “query posts after date custom field” – you should find plenty of threads on google!
Cheers
E
Hi @Arttweb
I doubt one of the ‘More fields’ developers will be reading this thread, so I wonder if this is the best place to ask this question.
I don’t have a solution to this answer as it currently sits outside the scope of the core plugin.
Perhaps you could look at the DB data and export / import the fields?
Thanks
E
Hi @kristian
Can you please elaborate a bit more on this question?
Thanks
E
Great! You learn something new everyday when coding, that’s what makes it fun 😉
No problem Dadra, glad to help out!
Quick follow up question – how do I get a list of field group ID’s given a post ID?
That did it!
I guess I should have been clearer from the start, but I thought my initial approach was totally off base so I didn’t even mention it.
Thanks so much Jonathan! I really really appreciate it.
If something strange happen, like this one, always check httpd errors first.
I got a similar problem in acf field creation area.
[error] [client 127.0.0.1] PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0, referer: http://local.dev/wp-admin/post.php?post=728&action=edit
Yep, error tells you what to do. Just increase max_input_vars value in your php.ini. I see my local installation dont even have this value but you can just add it to php.ini and restart server. It will work 🙂
Some discussion on this: http://stackoverflow.com/questions/10303714/php-max-input-vars
ahhhh!
Actually your code should work but you need to change it to this:
<?php
$selected = get_field('q_and_a_category_select');
$args=array(
'post_type' => 'q-and-a',
'q_and_a_category' => "$selected" //the slug for the custom taxonomy term
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php the_title(); ?>
<?php endwhile; }?>
<?php wp_reset_query(); ?>
you could put the get_field directly in the array but I think this looks more structured 🙂
Ok cool, I’m glad I’m making sense!
I’m using an acf select field, configured like this:
Field Name: q_and_a_category_select
Field Type: Select
Choices
design : Design
engineering : Engineering
project-management : Project Management
To fill you in on the history, originally I had three separate page templates, each displaying posts from a specific term. For example, I used this for the Design page:
<?php $args=array(
'post_type' => 'q-and-a',
'q_and_a_category' => 'design' //the slug for the custom taxonomy term
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php the_title(); ?>
<?php endwhile; }?>
<?php wp_reset_query(); ?>
This works great to show just the q-and-a custom posts assigned the term “design”, but I didn’t want to have separate templates for each one.
So the first thing I tried was this:
‘q_and_a_category’ => ‘<?php the_field(“q_and_a_category_select”); ?>’
I figured it would simply just plug in the proper term and I’d be good to go. But it didn’t work and I’m not skilled enough in php to know why not.
So I did some searching and found this acf tutorial: http://www.advancedcustomfields.com/resources/how-to/how-to-query-posts-filtered-by-custom-field-values
Seems like example 3 should do it, but no luck.
Thanks again!
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.