Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #1157104

    Larry K
    Participant

    hello,

    how or what is the easiest (best?) way to add custom headlines (or just html) BELOW entry-wrap and ABOVE entry-content?

    I’m guessing to use child theme to add custom code?

    or maybe add in function.php, the ability to add html in the correct spot PER PRODUCT I want to add html to?

    any help, code, or places to add code would be appreciated
    🙂

    #1157132

    Rupok
    Member

    Hi there,

    Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    #1158730

    Larry K
    Participant

    https://www.cowgirlsandlace.com/shop/tyler-wash/

    thanks

    SO I want a custom/unique headline on this page 🙂
    thanks

    PS. I would LOVE, LOVE to put this headline, style it via a field somewhere…
    so I could add the headline quickly, easily…

    thanks

    #1159008

    Darshana
    Moderator

    Hi there,

    Head over to X Addons section and install ACF Pro plugin and then create a custom field (Custom Fields -> Add New | https://snag.gy/DE8bQj.jpg). Set Rule option as Product (https://snag.gy/bNRSvm.jpg) and create a custom field as follows (https://snag.gy/rSbdAc.jpg).

    Now you can Edit a Product and set your Custom WooCommerce Title (https://snag.gy/5FJEtp.jpg)

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Then add the following code into your child theme’s functions.php file.

    
    // Add ACF Info to Product display page
    add_action( 'woocommerce_before_single_product_summary', "My_ACF_product_content", 10 );
    
    function My_ACF_product_content(){
      
      if(get_field('my_woocommerce_title')) {
        echo "<h5>" . get_field('my_woocommerce_title') . "</h5>";
      }
      
    }
    

    Hope that helps.