Home › Forums › Front-end Issues › Displaying a group outside WordPress Loop › Reply To: Displaying a group outside WordPress Loop
Hi @jazibzaman
I don’t know which tab plugin did you use and how to use it, so I’m sorry I can’t test it out. Here is my testing code in data.php:
<?php
// Include WordPress
define('WP_USE_THEMES', false);
require_once('../../../../../wp-load.php');
if ( isset($_GET['postid']) ){
$post_id = $_GET['postid'];
$fields = get_fields($post_id);
echo "<pre>";
print_r($fields);
echo "</pre>";
}
?>
To test it out, you need to open this URL:
http://example.com/wp-content/themes/your_theme_dir/includes/tabs/data.php?postid=99
Where “example.com” is your domain, “your_theme_dir” is the directory where you put your current theme and “99” is the post ID that has the custom fields.
It should show the fields in that post. So, the only thing you need to do is passing the post ID in the tab link.
I hope this makes sense.
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!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?
— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.
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.