Labs
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
Onepage website is modern trend among internet and you can view many beautiful onepage driven websites there. One of the main advantage of these kind of website is it can give easy and enjoyable experience for users. It is suitable for those who have little bit of text on each topic. it will also give […]
Labs
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
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
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
If you want to show a specific post from a tag on a WordPress page here is one of the best solution. Copy below code into your WP page where you want to display posts from the particular tag. You need to replace the part “tag=Your-Specific-Tag” with your tag. <?php query_posts(’tag=Your-Specific-Tag’); ?> <?php if […]
Labs
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
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
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
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
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; ?>
Labs
Adding below code snippet to your WordPress theme will display the total number of tags. <?php $number_of_tags = wp_count_terms(’post_tag’); echo $number_of_tags; ?> <?php $number_of_tags = wp_count_terms(‘post_tag’); echo $number_of_tags; ?>