How to display prices inside the AVADA theme for Woocommerce?

How to display prices inside the AVADA theme for Woocommerce?

Open avada-functions.php and search for this:

1
2
// Return the HTML markup of the post title.
		return '<h' . $custom_size . $entry_title_class . '>' . $title . '</h' . $custom_size . '>';

You will see above

2
3
$title = '<a href="' . $permalink . '"' . $link_target . '>' . $title . '</a>';
		}

Replace it with:

3
4
5
6
7
8
9
10
$price = get_post_meta( get_the_ID(), '_regular_price', true);
$price = number_format($price, 2,".",",");
$title = '<a href="' . $permalink . '"' . $link_target . '>' . $title . '</a><div align="center" style="padding-top:5px;">
			<div style="background-color:#F4F24D; font-weight:bold; color:#000; width:50%; padding:5px; font-size:21px;">$'.$price.'</div>
			</div>
			';
			//comment
		}

If you need help with this, you can contact me by leaving a comment to this blog post.

Add a comment: