Home › Forums › Front-end Issues › Can't see custom fields on Woocommerce shop page › Reply To: Can't see custom fields on Woocommerce shop page
sorry for the long delay, you’re reply got burried. Anyway, the post id should already be set up by this
$post_object = get_field('select_sidebar');
if( $post_object ):
// override $post
$post = $post_object; // this set up the post data including the ID
setup_postdata( $post );
?>
<div class="col-xs-12 col-sm-4 sidebar">
<?php if( have_rows('sidebar_blocks') ): ?>
If this is not working then I’m not sure what the problem is. It could be that the global $post is not defined. Try defining it by adding
global $post;
before $post = $post_object;
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.