[Support request] ACF on Woocommerce Archive Page With Hook

Home Forums Support [Support request] ACF on Woocommerce Archive Page With Hook

Home Forums Support ACF on Woocommerce Archive Page With Hook

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1676205
    Scott

    Hello guys!

    I created an ACF field to show additional description/text at the bottom of Woocommerce Global Attribute Term Archive Pages. Text field shows and I have entered text into one of the attribute terms. I then created a hook in Elements to show the ACF shortcode ([acf field=”bottomtext”]) in the hook “woocommerce_after_shop_loop”, checked the execute Shortcodes box, and Set the Display Location to the Product Attribute pages. But, nothing shows. Have I missed something?
    My purpose is to add SEO friendly text at both the top and bottom of the archive pages for SEO purposes if you have a better way. The top text comes from the included archive description field.
    Thanks for your help!
    Scott

    #1676588
    Elvin
    Staff
    Customer Support

    Hi there,

    Can you confirm if the shortcode actually works? Can you try testing it on other hooks like generate_after_header and add HTML comments (ex: <!--ACF bottomtext--> ) to it for markers?

    Let us know.

    A wise man once said:
    "Have you cleared your cache?"

    #1676972
    Scott

    I changed the hook the generatepress_after_header and added the HTML comments. The comments showed in the page source but the shortcode didn’t work. I also tried using the PHP command <?php the_field(‘bottomtext’); ?> (and checked the PHP box) and it didn’t work either?

    #1677095
    David
    Staff
    Customer Support

    Hi there,

    those tests prove the hook works – the issue will be related is the_field function is not specifying where the field is coming from.

    This article explains using ACF fields on a taxonomy archive – the same should apply to the global attributes:

    https://www.advancedcustomfields.com/resources/adding-fields-taxonomy-term/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.