To check if the product is on sale by using the product id: Get product object using product id => ($product = wc_get_product($id);) Get sale price of product => ($sale_price = $product->get_sale_price();) Lastly, get the price of product => ($price = $product->get_price();) Conclusion: get_price() method return the current active price. So, if the sale is […]
Super Rishi - Just Another Programming Geek
To create custom post type in WordPress there are two ways. One way is to do it by plugin and Second is to create custom post type by the code itself.
Below is the code to create a custom post type […]
Super Rishi - Just Another Programming Geek
To custom order WordPress posts or custom posts type add following code to your functions.php file in your theme folder: WordPress query to get posts ordered by menu order […]
Super Rishi - Just Another Programming Geek
Contact form 7 includes its CSS and JavaScript files to all the pages even when there is no contact form on the page. This adds up more load to the page and includes unnecessary files which may conflict with other CSS and JS. It is a good practice to remove these files from all pages […]
Super Rishi - Just Another Programming Geek
There are generally two types of WordPress pagination you would see. One has the previous posts and the next posts link only, at the bottom of the page to navigate to next and previous lists of items or posts. Second shows all numbers of pages available to navigate to and the user can jump over […]