Hello!
OK, so I understand the the conditional code that you have provided, as well as how to make a template. But my problem is that I need to have the PHP work inside those fields, as I want to be able to change the content inside the rep_card_content
. Is there a work around to this problem without having to have PHP in the text area?
For example: http://image.prntscr.com/image/3caee2eb014c43adb02e24648f6f1050.png – I want to be able to edit the content through the custom fields in the rep_card_content
while being able to add more rep_card_content
s.
Hello!
Sorry, I don’t really understand what I should to do to display the PHP from the textarea with the code you have given.
So for the first part, I should use that code to only display content if there is content in the custom field, or is it to show the PHP? Also, I don’t quite understand why you did <div="<?php the_field('rep_last_name'); ?>"
and ended it with a </span>
?
Also, I’m a bit confused on what to a shortcode’s use is. :S Is it to show the PHP in the textarea?
Thanks for helping!
Hello!
I want to be able to add and delete content easily as not all pages will have a set number of rep card contents, rather, there will be any where from 1-3.
So basically I need to replace the PHP inside the textareas to for example the first one, [acf field="{rep_last_name}"] ?
Then for the echo code, where would I put that?
Hello!
So, I created a field named “rep_card_content” and to display it on the template, I put <?php the_field('rep_card_content');?>
. In this case, I want to be able to add ACF custom values and display them in the ACF area to display the content, as shown here:
http://image.prntscr.com/image/3caee2eb014c43adb02e24648f6f1050.png (ACF Field)
On the front end, however, the PHP shows up as raw text, and not the content that I input in the page’s custom field:
http://image.prntscr.com/image/432ea67f68d84e42ae6d8e4890d46faf.png (Front end PHP)
I want the fields to show up as the content I set it to in the admin panel, similar to how you guys have the option to convert HTML to HTML.
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.