Home › Forums › Front-end Issues › Displaying a group outside WordPress Loop › Reply To: Displaying a group outside WordPress Loop
Hi James, I got it working with the GET variable.
Here is my data.php code.
<?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/wp-load.php');
$post_ID = $_GET['id'];
$custom = get_post_custom($post_ID);
foreach ($custom as $key => $value) {
if (($key != '_edit_lock' && $key != '_edit_last'))
echo '<tr><td>' . $key . '</td><td>' . $value[0] . '</td></tr>';
}
?>
Can you please explain me a little more that how can i add single custom field using the_field after closing php tags like that
<?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/wp-load.php');
$post_ID = $_GET['id'];
$custom = get_post_custom($post_ID);
foreach ($custom as $key => $value) {
if (($key != '_edit_lock' && $key != '_edit_last'))
echo '<tr><td>' . $key . '</td><td>' . $value[0] . '</td></tr>';
}
?>
<span class="aps-1co"> <?php the_field('device_type'); ?> </span>
<span class="aps-1co"> <?php the_field('data1'); ?> </span>
Do i need a closing php tags again? because the_field is not working and the upper php section is working.
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.