Home › Forums › Front-end Issues › Prepend and Append Do Not Appear after update
After upgrading either to WordPress 3.8.1 or ACF v4 I am having issues using the prepend and/or append when using conditional logic.
Here is my setup.
The ACF Title is “Course Post”, and the Location “rules” will “show this field group if” “Post Type” “is equal to” “course”
When I create a new “course” everything on the back-end works perfectly fine.
In Field 1 – I have a “select” field type (field name is Textbook_Option)
that asks “Do You Have a Textbook?”
with the options Yes and No (Default is No)
In Field 2 – I Have a “text” field type, (field name is textbook_title)
that will display when the conditional logic meets the following:
“Do You Have a Textbook?” “is equal” to “Yes”
When I select Yes on Field 1, Field 2 displays the field input (as expected)
Here is the issue
When I created the Field group, Field 2 (textbook_title) I have the following text that should prepend the input field “Title:” (I have also tried it without the “:”)
On the backend the prepend “Title:” Displays correctly
However, when I publish, the prepend does not display at all.
The published post acts as if no prepend was ever made.
All of this is built using shortcodes and this worked when I created all of the “course”s during the calendar year of 2013
I am not sure if this is an issue with WP 3.8 or if it is ACF4, or if it is me. Any suggestions?
Thanks
Hi @dgurle20
The ‘prepend / append’ settings are purely visual – they don’t effect the data saved into the DB.
Thanks
E
Thank you @elliot for the quick reply.
Before the update to acf or wp the prepend would display on the front end. E.g. If I had “Title: ” in the prepend and “WordPress 101” in the input field. The front end would display “Title: WordPress 101”.
The displaying of the prepend of the input field is no longer happening. The “Title: ” is not displaying on the front end, just the value put in the field input.
Thanks Elliot.
As Elliot said those settings are purely visual, and will not be saved in the database, meaning you can’t show them in the front-end.
What you can do it code the prepend in your theme, since you know where it’s supposed to be. Simply create something along the lines of:
<?php if (get_field ('textbook_title') ) : ?>
<p>Title: <?php echo the_field ('textbook_title'); ?></p>
<?php endif; ?>
Thank you @elliot and @matiasvad for the quick reply’s.
I will work to drop this into the child theme, and I am sorry for my stubbornness but I would like to ask a couple of follow up questions.
If the prepend/append is not stored in the DB, then how does the prepend/append store information to display the prepend/append on the back end?
Secondly, If this cannot be displayed on the front-end, then what is the purpose of the prepend/append? — Is it to assist in filling in the form? Can you send an example of the uses?
I was having trouble finding this in the documentation.
Thank you guys so much, and again I am sorry if I sound like I am complaining because I am not. I beyond grateful for all that you do and for ACF.
Thank you again.
Hi @dgurle20
These settings are purely visual for the back-end. They are not loaded on the front end, however you can always load in the field object get_field_object
and look at it’s data to find the prepend / append settings.
Thanks
E
Thanks @elliot.
I went with something similar to this to hard code the file.
I know this isn’t the most efficient but the load time is almost identical and updating will be far easier for co-workers if they need to make edits in the future.
. '[/toggle_item][toggle_item title="Textbook" active="false"]'
. $value = get_field( "textbookTitleH1", 23690 )
. $value = get_field( "textbookTitleUserInput" )
The script is built within a toggle shortcode
Thank you again so much for all of your hard work.
Hi Eliot;
I need append / prepend data to decorate the value in the front end but they are not getting loaded using get_field_object or get_field_objects.
Other key / values are coming as expected in the array.
The topic ‘Prepend and Append Do Not Appear after update’ is closed to new replies.
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.