It would probably help if you showed some code.
I’m a friend of semantic HTML and progressive enhancement, and that means that something should work at least in a basic way without JavaScript in the first place, and then it should be enhanced with JS. That means, by default, the testimonials could be displayed below one another, and the whole “slider” and “active class” and “pagination” thing would be created with JS, so ACF has nothing to do with any of that.
These empty spans and list with “dots” have nothing to do in there, this should be generated by JS. Since WordPress works with jQuery by default you could use a jQuery slider plugin such as Cycle; this will generate all the functionality you need.
No, I mean whether the field has any content (or rather, is anything selected, if it’s a select field) in the admin area where this field appears? You are giving very little context here.
That it returns “false” sounds like nothing is selected or it has no value assigned. Could you please share the field settings and what it looks like in the admin screen?
We need more info. What does the template code look like? Are there any errors in the server log?
It’s really hard to tell without being able to look at the whole picture. That’s probably why nobody has answered so far. Perhaps it’s something with the field names that is conflicting with something else on that server? Would renaming the fields do the trick?
What happens if you do the_sub_field('bild')
? Does it return the same value everytime?
I’m not sure I’m understanding this correctly but if the feature field is a simple text field, it will return plain text. If you need an array, you need to explode the text first (or whatever else) and use that.
Yes, the PHP would go in functions.php. And the JS (jQuery) goes into a JS file in your theme directory that is enqueued (as that tutorial also explains).
I only know of a third-party OpenStreetMap field for ACF: https://wordpress.org/plugins/acf-openstreetmap-field/
Does the field actually have any value?
I would probably use a (nested) repeater field here. The first level would resemble the tabs (have a text field for “tab label” and another repeater inside (second level) for the table rows). You then retrieve the values as described in the documentation for the repeater; HTML and CSS do the layout stuff.
I guess we need more info than that. What are these true/false fields? Radio buttons? Button groups? What are the return values? Could there be typos in the code?
Sounds like you need a relationship field on your user pages to associate a custom post with a user?
Uhm, not sure if I’m misunderstanding you but URLs of single posts are simply output with the_permalink() https://codex.wordpress.org/Function_Reference/the_permalink
So, in order to put a link to your single post you’d have:
<a href="<?php the_permalink(); ?>">read more</a>
(of course instead of static “read more” text you could as well put the post title there or whatever)
OK, after a long while I got back to this issue and solved it by comparing the date of the previous post in the loop with the date of the current post. The problem was that this wasn’t easily possible in templates that are retrieved with get_template_part was used. I had to use set_query_var() to make the date from the previous iteration available in the template part. Here’s my solution:
in the main template I have:
while(have_posts()):
the_post();
// retrieve event date set in ACF
$event_date_raw = get_field('b_date');
set_query_var('event_date_raw',$event_date_raw);
get_template_part( 'entry', 'event');
/*
assign the current date to a variable and pass it to template part in the next iteration
so that it can be compared with the date of the next post
*/
set_query_var('prev_date_raw',$event_date_raw);
}
endwhile;
and in the event sub-template I have this:
// current post’s publication date by native WP functionality
$post_date = the_date('d.m.Y','','',false);
$prev_date_raw = get_query_var('prev_date_raw');
if($prev_date_raw) {
// convert event date objects to datetime strings
$prev_date = DateTime::createFromFormat('d.m.Y H:i', $prev_date_raw);
$prev_date = $prev_date->format('d.m.Y');
}
$event_date_raw = get_query_var('event_date_raw');
$event_date = DateTime::createFromFormat('d.m.Y H:i', $event_date_raw);
if($event_date) {
$post_date = $event_date->format('d.m.Y');
}
// check whether the current post/event date is the same as the previous post’s date, and if not, print date
if($post_date !== $prev_date) {
?>
<div class="date"><?php echo($post_date); ?></div>
<?php } ?>
This appears to be a duplicate of https://support.advancedcustomfields.com/forums/topic/get-id-of-woo-commerce-product-through-acf-page-link/
Please close this thread so there is no confusion.
What does the page link field actually return? Does it return a plain URL? And is the value the field returns identical to what get_permalink() or $post->ID return?
It appears this is a duplicate of https://support.advancedcustomfields.com/forums/topic/retrieving-saved-acf-values/
Please close this thread (or the other one) so we don’t have confusion.
Have you updated your plugin lately? What happens if you revert to the previous version? If it works then, it might be a bug.
So, you have created a field, assigned it to your custom post type, and it shows up in the post editing screen, right? You have entered a value and saved it, and it doesn’t show up on the actual post/page?
It sounds like you’re not pulling the right template or something. Can we see a demo and/or get more info about your theme set-up?
Anyone got any idea? I’d be very thankful for any help.
We need more info than that. What are you refreshing? The admin area of the home page? Or the public facing home page? Is the field group in which the field resides set to show on the home page? Is the template code implemented on the respective template? Adding fields is usually a two-step process, you know?
I guess it’s a little more intricate than just creating a simple text field. I’d suggest using categories or custom taxonomies to which you associate your posts/entries. You can then use the category link to get the list of posts associated to that category.
How are you adding the link in your pages? With a template tag or via shortcode? Clearly, somewhere the output HTML for the link must be generated in some template (or functions.php?).
Looks like this is handled with a repeater field? I’m not sure whether that’s a good approach if you’re handling a lot of entries; to me it feels like a custom post type would be more appropriate.
But since converting that would probably go beyond the scope of the project we’ll try to work with what we’ve got.
On the news articles page the oldest entry I see is “Why the U.S. Power Grid’s Days Are Numbered – Bloomberg News” on page 13 of the list, dated August 22, 2013; this also corresponds to the screenshot you showed. What do you mean by “the oldest of the two articles loading is January 12, 2013”? To which page are you referring?
As to the broken links, that’s not your fault, it’s just the fact that these pages don’t appear to exist at the specified URLs on the third-party websites anymore, and/or the website owners haven’t established proper redirections. For example, searching the internet for “The tortoise and the flare: Calif. solar power projects confront habitat impact” (dated January 23, 2014 in your list) brings me to this location now, i. e. the URL format has changed over the years. You need to update that manually if the website owners didn’t create proper redirects. You can use the W3C Link Checker to check all links on a page and find which ones are broken (be patient while it’s running the check).
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.