Facebook loads new posts on timeline and news feed as you scroll down. This makes Facebook home page and profile load faster as Facebook don’t have to load everything on page load. For achieving this Facebook uses a technique called as Infinite scrolling. In this tutorial we will see how to achieve infinite scroll using […]
Here is the code to add custom post type to archive pages <?php //$q is the global query object. Its type is WP_Object. function add_custom_posttype_to_archive($q) { if(is_admin()) { return; } if(is_tag() || is_category()) { if($q->is_main_query()) […]
Here is the code to add custom post type to search result <?php //$q is the global query object. Its type is WP_Object. function add_custom_posttype_to_posts_search($q) { if(is_admin()) { return; } if(is_search()) { if($q->is_main_query()) […]
Here is the code to add custom post type to posts index page <?php //$q is the global query object. Its type is WP_Object. function add_custom_posttype_to_posts_index($q) { if(is_admin()) { return; } if(is_home()) { if($q->is_main_query()) […]
This post is a part 4 of HTTP/2 Complete Tutorial post series. Headers in HTTP/2 provide information about the request or response. Header take around 800 bytes of bandwidth and sometimes few KB if it carries cookies. Therefore compressing headers can reduce the bandwidth latency. So HTTP/2 introduced header compression. Header compression is not like […]
This post is a part 3 of HTTP/2 Complete Tutorial post series. Server push is a method in HTTP/2 which allows server to send multiple responses for a single request. This feature decreases the latency in loading a webpage. To make an HTTP/2 request client first checks if a TCP connection is already open or […]
This post is a part 2 of HTTP/2 Complete Tutorial post series. Multiplexing is a method in HTTP/2 by which multiple HTTP requests can be sent and responses can be received asynchronously via a single TCP connection. Multiplexing is the heart of HTTP/2 protocol. Frames and Streams HTTP/2 is a binary protocol. Every HTTP/2 request […]
This post is a part 1 of HTTP/2 Complete Tutorial post series. One of the biggest question that comes in is how is old browsers going to deal with HTTP/2 web servers and vice-versa. HTTP/2 uses an Upgrade and Discovery method to find if a server supports HTTP/2 or not. An HTTP/2 client never makes […]
HTTP/1.1 was introduced in 1999 and since then the web has changed. More people are accessing websites in mobile and tablets which have relatively slow connection and the number of external resources per page is increasing with causing increase in page load size. Although many HTTP clients and server side hacks had been implemented to […]
Most Commented