Support for Envato Buyers › Forums › DGWork › Can you please help me with this costumization
- This topic has 3 replies, 2 voices, and was last updated 5 years, 1 month ago by FocuxTheme Support.
-
AuthorPosts
-
-
November 23, 2019 at 10:30 am #26731ezworksParticipant
Hello,
before anything else, thank you for dedicating your time to solve the problems I previously posted.
On this occasion I need your help with a different matter – it is not a bug or something that does not work.
On the product page, there is a “Details” section on the right sidebar, the one in this image https://imgur.com/7wVNMre
For my products, I need more details to be displayed there. I am using the Advanced Custom Fields plugin to create new fields in the product post page, but I don’t find a way to display them on the product page.
I did it a couple of months ago, but I made the changes on the main template and on the next update I lost them… Now I can’t find the place where to input those changes.Can you please tell me what part of the template do I have to edit, and how to do this on the child theme so I don,t lose the changes anymore?
Thank you!
-
November 25, 2019 at 9:02 am #26799FocuxTheme SupportKeymaster
The recommended method is that you can add more detail items to the “Additional Information” field on the product editing screen without changing the codes. https://www.dropbox.com/s/1mg8gqx4ns38g85/WechatIMG51.jpg?dl=0
Write the item content format as below
- xxx: xxxx
If you want to add an icon, you can write as
- xxx: xxx
You can refer the icon usage on https://fontawesome.com
Also, if you want to customize the template instead of the method above. Just activate the child theme, and add the following function to the functions.php
function dgwork_item_details(){ global $post; $details=''; $append_license = ''; $last_updated_date=esc_attr(get_post_meta($post->ID, "_dgwork_last_updated_date", true)); $file_type=esc_attr(get_post_meta($post->ID, "_dgwork_custom_file_type", true)); $file_size=esc_attr(get_post_meta($post->ID, "_dgwork_file_size", true)); $license=esc_attr(get_post_meta($post->ID, "_dgwork_license", true)); $requirements=esc_attr(get_post_meta($post->ID, "_dgwork_requirements", true)); $custom_license_group = get_post_meta( get_the_ID(), '_dgwork_license_info', true ); $additional_details = get_post_meta( get_the_ID(), '_dgwork_additional_details', true ); $details.=''; echo wp_kses_post($details); } endif;
Use get_post_meta($post->ID, ‘custom_field_name’, true); to output the value.
But I don’t recommend this way, because if we will update this part in the future, you may have to change the codes again. So I still recommend the first method.
Thanks
-
November 26, 2019 at 9:31 am #26835ezworksParticipant
Thank you for your help!
-
November 26, 2019 at 7:40 pm #26847FocuxTheme SupportKeymaster
You’re welcome!
-
-
AuthorPosts
- You must be logged in to reply to this topic.