options_de_CH_shp_gantrisch_adb_single_page
and options_fr_FR_shp_gantrisch_adb_single_page
and the values are visible/editable in the admin screen. But using get_field('shp_gantrisch_adb_single_page', 'options')
always returns a null value. WordPress 6.3 and plugin 1.1.11.
]]>TL:DR looking for a function that’s similar to ACF’s get_field().
]]>I nhave a acf that is filter to be filled after a specific category is selected.
I need to get this field data on wp save_post hook, I’d even try the wp_after_insert_post hook, booth withouth succes.
Searching answers I’d find a lot of references to the ‘acf/save_post’ hook.
I just try to get what data this hook have but with no success either.
The code to test the acf/save_post hook on my functions.php theme file:
function test_acf($post_id) {
error_log( 'Saved post ID : ' . $post_id, false);
error_log( var_export($_POST, true), false );
//If you want to log what got saved to the database
error_log( var_export(get_post($post_id), true), false );
}
add_action('acf/save_post', 'test_acf', 20);
]]>Do I have to use an identifier or how do I display this?
<?php the_field(‘one’); ?>
<?php the_field(‘two’); ?>
<?php the_field(‘three’); ?>
Thank you guys!
]]>I think It’s been caused by me updating to PHP 7.4 when I’ve transferred where the website is hosted. I’ve Googled some fixes and have found the lines in the file pagehome.php but haven’t felt confident making the suggested changes!
I think it’s causing my SSL to not load on the home page only. I also think it’s causing an issue when trying to update to the latest version of WordPress.
Images links below:
https://totalcool.co.uk/wp-content/uploads/2021/11/unnamed-2.png
https://totalcool.co.uk/wp-content/uploads/2021/11/unnamed.png
]]>I ve created a custom field assigned to order. In fact its a field that i give the courier tracking code.
I use the the_field(‘courier’) on the template of pdf but it shows nothing.
Any ideas?
Thanks in advance
Chris
I created multiple fields of the image field type and would like to get all of the field data of the image field type. So far both get_fields() and get_field_object did not let me achieve this and could not find more relevant information in the ACF documentation pages.
Can someone please post the steps to show all of the images of the image field type in a single page?
Thank you in advance.
]]>Note, I?have set the WP date format the same as the ACF plugin date format i.e. ‘d/m/y’.
Code below sort of works. If I’m reading this right since the_field has an embedded echo it should print out the value of ‘event_date’ as a string argument
$eventDate = new DateTime(the_field('event_date'));
echo $eventDate->format('M');
When I say sort of I meant it does not error out but produces this: the event date + publication month which is not what I want or expect at all. The only way to get the event date in the form of the month is to use this code….
$eventDate = new DateTime(get_field('event_date', false, false));
echo $eventDate->format('M');
Code below does not. Again if I’m reading this right this returns a value which contains the date held in ‘event_date’. I really can’t see what the problem is here.
$eventDate = new DateTime(get_field('event_date'));
echo $eventDate->format('M');
ERROR RETURNED IS:
Upcoming Events
FATAL ERROR: UNCAUGHT EXCEPTION: DATETIME::__CONSTRUCT(): FAILED TO PARSE TIME STRING (19/09/2019) AT POSITION 0 (1): UNEXPECTED CHARACTER IN /APP/PUBLIC/WP-CONTENT/THEMES/MYTHEME/FRONT-PAGE.PHP:34
According to the documentation: the_field();
Intuitive and powerful, this function can be used to output the value of any field from any location. Please note this function is the same as echo get_field();
Additionally when I used this on another part of my page as a test it did not print anything out?
<h1><?php the_field('event_date'); ?></h1>
Thank you for any advice
]]>