WordPress post template by category ID

We have been working on the Leisure Holdings websites. All the sites are developed with WordPress. Here is a quick script to add to your functions.php so each category can have its own post template (single.php). Example: If the category number is 13 then the file...

How to add a date box beginning of a paragraph with CSS

Here is what we need to achieve, it was very simple with CSS. I was also able to easily add it to a WordPress template. The HTML 31 Oct The CSS .date-box { background: #93C647; width:50px; float:left; margin-right:10px; margin-top:5px; } .date-box p {...

How to add class to first post in WordPress Loop

When working with a loop in WordPress sometimes it is necessary to add a different class to the first element in the loop. Example: A website may have a custom post type for featured images that will be slides in an image carousel on the home page of a website. The...

How to attach to Boostrap Carousel Slid Event

We are working on the Prince Tennis Website. There is a carousel with four images, and these correspond to four different widget sections. So we had to listen to the slid event of the carousel, get the index of the active slide, then change the corresponding widget...