Vishmax.com
LAB

Coding Fundamentals

Coding & Programming Resources for web design and development.

Labs

WordPress code for notify members on new posts

If you want to notify your WordPress site users then here is a quick solution which work fine. Add below snippet to the functions.php of your wordpress theme and your users will get email notification once there is a new post.   function email_notification($post_ID) { global $wpdb; $usersarray = $wpdb->get_results("SELECT user_email FROM $wpdb->users;"); $users = […]

Labs

Apply random background colour to div with demo

If you would like a create a webpage which change the background color randomly every time the page is loaded then here is a fine solution. There are multiple ways to this, in this tutorial we will use a bit of JavaScript and the below code works fine with modern browsers like Google chrome, Firefox […]

           
Labs

Animated checkbox using Css3 tutorial with live demo

As the web technology is getting advanced the websites are also becoming more advanced. In this post we are explaining about checkbox which is used widely in html forms. This is an animated check box which can use to make html form more attractive. Below is the full code for this tutorial and you can […]

Labs

How to create a search page in wordpress

Creating a search page is an essential part of WordPress theme development. Here is a post which contains how to create a search.php page in a better way. Search.php is the page where the theme will show all search results, so displaying search results we need to create two things, first is a search form […]

Labs

Simple CSS3 Star rating system demo with tutorial

Here is a simple 5 star rating demo with code which is built on pure CSS (CSS3). Bottom of the explanation code you can find the live demo button. If you think its is useful then please share! CSS .wrapper{ float:left; width: auto; margin:8% 0 0 35%; } .css3-rating-stars, .css3-rating-stars label::before{ display: inline-block; } .css3-rating-stars […]

Labs

Create hide / show notification bar with css3 tutorial and demo

Here is a good tutorial and demo on creating a notification bar using only CSS3. This example didn’t use a single line of JavaScript, so its is fully user and browser friendly approach. CSS   :root .max-notificationbar, .max-notificationbar label, .max-notificationbar label span{ display: block; } .max-notificationbar, .max-notificationbar *{ margin: 0; padding: 0; } .max-notificationbar > […]

Labs

How to notify registered user when there is a new post

If you want to send an email notification to registered members of your blog then here is a simple solution. Just copy and paste below code to your functions.php file.   <?php   function email_members($post_ID) { global $wpdb; $usersarray = $wpdb->get_results("SELECT user_email FROM $wpdb->users;"); $users = implode(",", $usersarray); mail($users, "New post on blog", ‘New post […]

Labs

How to optimize WordPress robots.txt file

Below is a example for robots.txt file which can effectively use on a WordPress website / blog. Just open notepad and add below contents to it and just save it as robots.txt. Once created upload it to root of your server. Below format will give a overall idea for optimizing robots.txt for WordPress and you […]

Labs

How to show the total number of comments in WordPress

Adding below code snippet to your WordPress theme will display the total number of approved comments.   <?php   $number_of_comments = get_comment_count(); $number_of_commentsm = $number_of_comments[’approved’]; //approved,   echo $number_of_comments;   ?> <?php $number_of_comments = get_comment_count(); $number_of_commentsm = $number_of_comments[‘approved’]; //approved, echo $number_of_comments; ?>