Home › Forums › General Issues › Woo Commerce Banner Image
Please Help, I’ve created an archive-product.php and in it I have my,
<?php woocommerce_content();?>
In the global-top-banner above this, I have my usual php code to call in my theme banner image (using my usual ACF image ID). Works perfectly on all other, page.php, single.php, category.php, etc…
The button to add the picture is showing on the backend on the Store page as its seeing my ACF rule to add to all default pages, and I can obviously select the image I’d like to choose from the media library here.
However I can not find any ACF selector to display the image on this Store page??…
I’ve tried trying to add a;
Template Name: Woo Page – but that doesn’t work – as it doesn’t appear on the Store (backend) to select.
I’ve read that… even though this Store appears as a page it gets converted to a ‘Special Archive’ but I can’t tap into this using Taxonomy = Category or Taxonomy = Prod_Category…
How do I get this image to show on this page please…
(archive-product.php code below)
<!– Main –>
<main>
<!– Top Banner –>
<div class=”thin-top-banner”>
<?php get_template_part(‘top-banners/global’,’top-banner’);?>
</div>
<!– Section One | Centered Content –>
<section class=”centered-content”>
<div class=”woo-content-container”>
<?php woocommerce_content();?>
</div>
</section>
</main>
The store page is showing an archive of, whatever you have WC to show own the archive. The page is really just a placeholder that when that page is loaded WC intercepts the main query and alters it so that it is no longer for the page but for an archive.
You need to provide a post ID value when getting the fields on this page. First you need to figure out how to detect that this is the page being shown. It may still be in the main queried object.
Try
$queried_object = get_queried_object();
echo '<pre>'; print_r($queried_object); echo '</pre>';
If this works then you can get the post ID from there.
You must be logged in to reply to this topic.
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.