• How can I add custom field in single product? I am using Pro Elements to design single product page, so how can I add there custom field. Thank you

    • This topic was modified 1 year, 12 months ago by Rihan Habib.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @xihad1, I reccomend you to use ACF plugin, its free and you can add a custom field very easy.

    This is an oversimplification, but it would be something like:
    Add new field group, select the post type (in your case product) and then you add the kind of field you want (number, text, url, etc…). This is all you need for the backend.

    For the fronted, if you are using text or number you can use a simple shortcode like this:
    This is a story about a boy named [acf field="name"]. He is [acf field="age"] years old.
    More documentation:
    https://www.advancedcustomfields.com/resources/shortcode/

    And if you need other types of fields, you need to edit the template files and add the code using the function get_field.
    The code would look like this:
    $value = get_field( "text_field" );
    You have documentation about this function here:
    https://www.advancedcustomfields.com/resources/get_field/

    Let me know if you need any more help.

    Thread Starter Rihan Habib

    (@xihad1)

    okay Thank you @sebaocano

    You are welcome, let me know if you need more help implementing this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I add custom field in single product??’ is closed to new replies.