I don’t follow. Prices should show by default if set. For simple product you must set ‘regular price’.
I would agree, I have the regular price set, and it shows on the shop page, but not on the individual product page.
http://www.onguardengineoil.com.php54-3.dfw1-2.websitetestlink.com/product/5w-30-premium-oil-synthetic-blend-single/
Can you check another theme? Will narrow the problem.
Now I feel sheepish, I switched to the parent theme and the price showed up. I had done something in the child’s functions.php which is why the price was not showing up. I updated the functions.php and now they are showing up like they should, but is there a way to get the price to show up next to the Add to Cart instead of just below the title?
Also I created a custom field for the products so I could delineate the different products without having to make the titles even longer. On the shop page the custom field shows correctly, Single, 6 Pack, Case, etc but when on a single product page the related products show the custom field for the product it is on.
I am using this code to the display the custom field:
<?php
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'amount', true);
wp_reset_query();
?>
Currently the only product with related products is the product I linked to previously.
Don’t use wp_reset_query. Will break the loop.
I removed the wp_reset_query but when I am on a single product page the products under You may also like… still show the custom field for the main product on the page instead of the custom field for the other products.
ie If I am on the 5w-30 Single (1 Quart) page, it is showing the 6 Pack and Case products under You may also like…, but For the 6 Pack and Case products the custom field shows Single (1 Quart)
global $wp_query;
$postid = $wp_query->post->ID;
Why get the ID from that instead of the global $product?
I am not the best at coding php, and that is the code I found to display custom fields. So I changes $wp_query with $product and ended up with:
<?php
global $product;
$postid = $product->post->ID;
echo get_post_meta($postid, 'amount', true);
?>
Which works and displays the correct custom field.
Thank you!