Theme: Mobile Friendly
WP version: 4.9.1
Problem: I have a created a field group (ACF) that has (2) fields; a) text (Mattaymom) and b) number (class_number) , and edited the single.php file, see below. When I view the single post this information (2) and other information (wp-textbox) displays OK. However, when the post is viewed by the user clicking on a category that links to the same post, this information does not display (2), and only the text from the wp-textbox. I would like to use more fields in the future once I can resolve this issue.
All the template functions (get_field, the_field, etc) can be used to load values from another post, however, a second parameter is required to target the post.
Each post has a unique ID which can be found in the URL when editing or found via code such as $post->id.
I believe when you are clicking the categories link it directs you to the category page instead of the post itself.
second reply: still not working?
Thank you for your prompt reply. I inserted the code you sent to replace my code into the single.php file, however the issue still remains. What you said in your explanation made a lot of sense, however I still cannot trouble shoot the problem, from looking on the internet and on your support site.
Thank you in advance.
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users