[Resolved] Woocomerce second title , with custom fields and elements

Home Forums Support [Resolved] Woocomerce second title , with custom fields and elements

Home Forums Support Woocomerce second title , with custom fields and elements

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #742998
    FunkyCss

    Hallo GP!

    I want to ask if is possilbe , with Elements to Display a custom field .

    I want to have second title on the woocomerce products , like IRON MAIDEN(CD PRODUCT TITLE) brave new world (Bellow the title)

    So i have created with ACF a custom field that i can insert my second title , and i want to make it work with elements ?

    Cause when i touched the PhP templates , it crashed some GP CSS styles .

    #743319
    Leo
    Staff
    Customer Support

    Hi there,

    Does this help?
    https://generatepress.com/forums/topic/subtitle-woocommerce/

    Let me know 🙂

    #743487
    FunkyCss

    Hey Leo thanks for your Reply but it was not enough . :/

    #743497
    FunkyCss

    Hey , what i did finally and it works but i believe is not the best way cause i notice some css brakings small , but visible .

    So i made with ACF a custom text field for woocomerce products . then i went to Functions.php and i made two actions there .

    1. For the Single Product

    add_action( 'woocommerce_single_product_summary', 'display_acf_field_under_title', 6 );
    
    function display_acf_field_under_title() {
    echo get_field('subtitle_');
    //'subtitle_' is the slug of the ACF
    }
    

    2. For the Category of Products

    add_action( 'woocommerce_shop_loop_item_title', 'andrew_display_acf_subtitle_on_category_page', 15 );
    
    function andrew_display_acf_subtitle_on_category_page() {
    echo get_field('subtitle');
    }
    

    * So i am letting this here for the next ones but i would apreciate if there is a way without installing ACF and work with custom fields that wordpress already has , and ELEMENTS.

    #743984
    Leo
    Staff
    Customer Support

    Thanks for sharing your solution!

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