Office Address

41/D, West Brahmondi, Narsingdi

Phone Number

+880-1975374887

Email Address

[email protected]

Include category id in body_class() and post_class()

Use this code on your themes functions.php to add current category id on body and post [php] function category_id_class($classes) { global $post; foreach ((get_the_category($post->ID)) as $category) $classes[] = ‘cat-‘ . $category->cat_ID . ‘-id’; return $classes; } add_filter(‘post_class’, ‘category_id_class’); add_filter(‘body_class’, ‘category_id_class’); [/php]

Read More

Get custom post count in custom taxonomy

To get total custom post count of a custom taxonomy use the follow code [php] $args = array( ‘post_type’ => ‘post type name here’, ‘post_status’ => ‘published’, ‘taxonomy name here’ => ‘slug of the category under taxonomy’, ‘numberposts’ => -1 ); echo $num = count( get_posts( $args ) ); [/php] For instance, if you had […]

Read More

Set a maximum upload count for users on a specific user role

Use the following code to limit 10 upload for specific role [php] add_filter( ‘wp_handle_upload_prefilter’, ‘limit_uploads_for_user_roles’ ); function limit_uploads_for_user_roles( $file ) { $user = wp_get_current_user(); // add the role you want to limit in the array $limit_roles = array(‘contributor’); $filtered = apply_filters( ‘limit_uploads_for_roles’, $limit_roles, $user ); if ( array_intersect( $limit_roles, $user->roles ) ) { $upload_count = […]

Read More

How to change “Registration complete. Please check your e-mail.” message in wp-login.php

You can use this filter to change the default “Registration complete. Please check your e-mail.” message on wordpress. [php] add_filter( ‘wp_login_errors’, ‘override_reg_complete_msg’, 10, 2 ); function override_reg_complete_msg( $errors, $redirect_to ) { if( isset( $errors->errors[‘registered’] ) ) { $needle = __(‘Registration complete. Please check your e-mail.’); foreach( $errors->errors[‘registered’] as $index => $msg ) { if( $msg […]

Read More
  • April 10, 2013
  • CSS

Best ways to detect IE browser

IE6 is a worse dream for every web developers. Good news is that Software giant Microsoft has released a new website with the expressed aim of killing off its Internet Explorer 6 browser. ie6countdown.com Still we have to deal with IE7 to IE9 Here is some way to cut down your development time by easily […]

Read More

Free HTML5 tools for developer

Since start of HTML5 it took the web to next level.Now most of the web development is implemented using HTML5 and css3 . Today i listed some HTML5 tools to reduce the development time. 1) Modernizr.com Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.It will add class on […]

Read More

Detect HTML5 Geolocation Support

Geolocation is the art of figuring out where you are in the world and (optionally) sharing that information with people you trust. To check if the user browser support Geolocation you can use any of the following techniques: Technique #1: By using a JavaScript junction. [code lang=”js”] function supports_geolocation() { return !!navigator.geolocation; } [/code] Technique […]

Read More

Hidden elements using HTML5

HTML5 introduce the hidden attribute, which will allow you to hide a specific element. So no need to use css display:none anymore! [php]<div hidden>You can’t see this text.This is hidden by HTML5 hidden attribute.</div>[/php] Source: http://html5demos.com/hidden

Read More
  • March 25, 2013
  • CSS

css only tooltip

Here is the html structure for tooltip [php][/php] Lorem ipsum dolor sit [php][/php] And here is the css styles [php][/php]/* base CSS element */ .tip { background: #eee; border: 1px solid #ccc; padding: 10px; border-radius: 8px; box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); position: relative; width: 200px; } /* arrows – :before and :after […]

Read More

9 Signs You Shouldn’t Hire THAT Web Guy

My employer specializes in creating websites for middle-sized businesses. We rarely create “Mom’n’Pops” websites and generally don’t pursue contracts with major corporations. Working with mid-size business has given me the opportunity to speak with executives and “decision-makers” within each business. Our discussions eventually end up with the other person telling me about their previous web […]

Read More