jQuery AJAX Call – How To Implement WordPress Ajax For Blog Posts

It’s not that hard to implement a simple jquery ajax call in your wordpress to get a post by its id for instance. In the following we will make this functionality from scratch, to implement this we will need to create a new file in our theme root folder: ajax.php, then, in this file we… Continue reading jQuery AJAX Call – How To Implement WordPress Ajax For Blog Posts

Detect Add To Cart Action – Woocommerce Add To Cart

Sometimes you need to detect add to cart action in woocommerce.  Once the customer has added any product in cart we will be able to notice him, or we can fire any event we need. For this action you need to have Ajax option “Enable AJAX add to cart buttons on archives” enabled. You can… Continue reading Detect Add To Cart Action – Woocommerce Add To Cart

Published
Categorized as Wordpress

How To Implement News Page In WordPress From Scratch – WordPress Tutorial Part 2

This is part 2 from our tutorial about how to implement a new news pages in wordpress from scratch. In this part we only make the css style for item posts, and add a more details button to the post. You will see in the following code. A little below we have the video of… Continue reading How To Implement News Page In WordPress From Scratch – WordPress Tutorial Part 2

Published
Categorized as Wordpress

How To Implement A News Page In WordPress From Scratch – Part 1

In this Tutorial I will show you how to add a new wordpress page to your website.  You will see, we will implement this page with few lines of code and everything will work as expected. The HTML and PHP code are here: <?php /* * Template Name: News */ ?> <?php get_header();?> <section id=”breaking_news”… Continue reading How To Implement A News Page In WordPress From Scratch – Part 1

Add to cart via AJAX Woocommerce without loop

To accomplish this functionality you have to make a GET call by javascript, in this call you have to pass the ID of product. Below you can see an example for this action. HTML: <div class=”add_to_cart”> <a href=”#” data_id=”12″>Add to cart</a> </div>   Where data_id is the product id.   jQuery: jQuery(‘.add_to_cart’).on(‘click’, function(e){ var href… Continue reading Add to cart via AJAX Woocommerce without loop