content top

Get post count of a category including sub-categories in WordPress

Get post count of a category including sub-categories in WordPress

From the title, you probably have guessed what I am going to talk about. In WordPress, we have many APIs to list down the category, but when we use the get_category function, it lacks the ability to show the post counts from its sub or child categories. Whereas, when we use query_posts or get_posts to get posts from a particular category, it returns posts from child categories as well. I faced this problem, while developing the 2nd version...

Read More

MySQL: Working with date time arithmetic #Part 2.3.1

MySQL: Working with date time arithmetic #Part 2.3.1

So, this is the second last part of the long awaited MySQL datetime series. Previously we have leant how to work with MySQL datetime datatypes and how to automate some insertions using some MySQL datetime commands. Obviously the only thing left to discuss is, the (difficult) datetime arithmetic inside MySQL. As in any language, the datetime arithmetic is not as straight forward as normal arithmetic. The reason is simple, we can’t say...

Read More

C Program: Replacing a substring from a string

C Program: Replacing a substring from a string

This is a nice piece of program I wrote a few months ago. One of my students requested me to write this. So, here it is! Hope this might be useful for you… #1: What the program does: This program finds all the occurrences of a sub-string within a given string and replaces that with our provided string. Basically there are many similar programs but, most of them lack the ability to find multiple occurrences. So I wrote this keeping in...

Read More

C Program: Adding two polynomials using Linked List

C Program: Adding two polynomials using Linked List

So, this is our first C program in the blog. We first thought of creating a separate blog for C & C++ related posts, but because of the maintenance issue, we finally decided to merge it to the main blog. So, without any further here is the program. #1: What the program does: This program is a practical implementation of the data structure “Linked List“. We use a linked list to dynamically store user input of polynomial...

Read More

TimThumb vulerability – How it got hacked & how to recover

TimThumb vulerability – How it got hacked & how to recover

In our last post, we talked about the fact that we got hacked because of TimThumb vulnerability. While fixing the vulnerability, I realized that, we were not the only one who got hacked. Plenty of websites using TimThumb to resize their images, got hacked. So, I thought of putting together a nice step by step guide on how to recover from this kind of hack. Please note that, while the nature of the hack may vary, we are trying to give an...

Read More
Page 1 of 5312345...1020...Last »
content top
TOP