Home Forums Art WordPress Theme Which file controls product title on single product

This topic contains 3 replies, has 2 voices, and was last updated by  BWSM 3 months ago.

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

    kleinimaging
    Participant

    Hi can you tell me which php file contains the code for the Product Title on single products (variable products), such as this one: http://dkmel.com/artwork/hacienda-family-tree-elliot-eastwick/

    I am trying to add an ACF (advanced custom field) below the product title.

    #15811

    BWSM
    Keymaster

    Hi,

    The title is from woocommerce plugin:
    /wp-content/plugins/woocommerce/templates/single-product/title.php

    Regards!

    #15814

    kleinimaging
    Participant

    Thanks for your reply, however, editing this file has no effect at all on the product title for some reason – even deleting all of the code on this page, or adding more code to the page, makes no difference to the appearance of the product titles.

    Please can you have another look and let me know?

    As a test, I am trying to put the word ‘Test’ on every product, to appear immediately after the title

    #15822

    BWSM
    Keymaster

    Hi,

    I add the “test”, I can see the “test” under title of single product page. Please test the code:

    replacing the codes of /wp-content/plugins/woocommerce/templates/single-product/title.php

    <?php
    /**
     * Single Product title
     *
     * This template can be overridden by copying it to yourtheme/woocommerce/single-product/title.php.
     *
     * HOWEVER, on occasion WooCommerce will need to update template files and you
     * (the theme developer) will need to copy the new files to your theme to
     * maintain compatibility. We try to do this as little as possible, but it does
     * happen. When this occurs the version of the template file will be bumped and
     * the readme will list any important changes.
     *
     * @see        https://docs.woocommerce.com/document/template-structure/
     * @author     WooThemes
     * @package    WooCommerce/Templates
     * @version    1.6.4
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly.
    }
    
    the_title( '<h1 class="product_title entry-title">', '</h1>' );
    echo '<div>test</div>';

    ——————————–
    If it doesn’t work, please send your question and wp-admin(url/user/pass) to uiueux@gmail.com, I’ll log in to check it.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.