css only tooltip

Here is the html structure for tooltip

Lorem ipsum dolor sit

And here is the css styles

/* 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 */
.tip:before {
position: absolute;
display: inline-block;
border-top: 7px solid transparent;
border-right: 7px solid #eee;
border-bottom: 7px solid transparent;
border-right-color: rgba(0, 0, 0, 0.2);
left: -14px;
top: 20px;
content: ”;
}

.tip:after {
position: absolute;
display: inline-block;
border-top: 6px solid transparent;
border-right: 6px solid #eee;
border-bottom: 6px solid transparent;
left: -12px;
top: 21px;
content: ”;
}

Source: http://davidwalsh.name/css…

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 developers and how their current site is ineffective as a sales tool or representation of the business. There are some definitive characteristics about my customers’ previous web persons and without further adieu, I give you 9 signs you shouldn’t hire THAT web guy.

1. He Calls Himself a “Webmaster”

Any web guy that calls himself a “webmaster” probably isn’t a master of anything. The term “webmaster” has become a translation for the word “amateur.” The web has diversified into so many different realms that webmaster is no longer meaningful (was it ever though?)

2. He’s a FrontPage Expert

Any developer / designer with a degree knows that Microsoft FrontPage most definitely isn’t a professional tool. FrontPage will pass for Mom and Dad who want to create a website dedicated to their dogs, not someone who’s trying to do business. I’d argue that a solid Web Developer should work at code level.

3. He’ll Submit Your Website to [Inflated Number Here] Search Engines

Submitting your website to hundreds of search engines would be great…10 years ago. Websites are indexed by relevant search engines by how rich their content and keywords are. Search engine optimization is big business and submitting sites to search engines simply isn’t the way to get to the top of Google.

4. He Wants a “Designed By ….” Plug on the Bottom of Every Page

You’ve paid this person to create a marketing tool for you — not a billboard for him. Your website is a launch pad for your business and Poindexter McScooner is simply the man behind the curtain — keep him there.

5. He Created a Cool Website for [Insert Family Member / Friend Here]

Your business needs someone who’s been there before. The most common answer to my “Who was he and what business did they work for?” question is “Oh, he did a website for the CEO’s daughter’s [insert lame organization here].” I honestly hear that friend-of-a-friend story all the time. Choose someone with a sizable portfolio that can provide references.

6. He Can Make You a Great Splash Page Flash Animation

Translation: “I can spend dozens of hours wasting your money to create something that will take too long to load and will be skipped more times than dessert at a bad restaurant.” Consistency and website flow are important to web design — not meaningless animations that waste visitors’ time and your money.

7. He Mentions He’s a HTML Expert

Who the hell isn’t? I would argue that dropping any language acronym on a customer (PHP, Ruby on Rails, ColdFusion, etc.) unless they ask is meaningless fluff. A mechanic could use a banana on my car if it would fix it. Keep your tools, especially HTML, to yourself — the customer doesn’t care.

8. He’ll Fit a Cool Counter on Your Site

You’ll add an ugly relic of the early internet on my site so that my competitors have an idea of my web stats? Sweet! Counters make a website look as unprofessional as possible — don’t use them.

9. He’ll Place a “Best If Viewed in…” Message on Your Website

Any real Web Developer knows that he doesn’t make the rules. Follow standards in the initial build and then fix it in Internet Explorer — that’s the flow. No responsible programmer would place a “best if view in…” message on the front-end of a website.

Get this article from David walsh blog

HTML5 Audio

Previously we uses flash to play audio files.Now HTML5 support a new element called Audio.It will give web developer much controls to do funny stuffs with audio.No need to use flash any more!

<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
 <!-- add your fallback solution here. Like you can add flash here for older browser-->
 <p>Oh! Your browser does not support the HTML5 audio element.</p>
</audio>


Internet Explorer 9+, Firefox, Opera, Chrome, and Safari support the element.
For more detials about html5 audio you can visit this post Playing audio files with HTML5.

get post publish date outside the loop in wordpress

get post publish date outside the loop in wordpress

To get post publish date outside the loop in wordpress use the following code.

$all_posts = get_posts(array('numberposts'=>-1, 'post_status'=> 'publish')); //Get all published posts
foreach ($all_posts as $single_post){
    echo get_the_time('Y-m-d', $single_post->ID); //The date is on Y-m-d format
    echo '<br />' ;
}

Hope this code will help you.
Thanks

Get Template Path in WordPress Child Themes

To get the child theme path use this code on your child theme

<?php echo dirname( get_bloginfo('stylesheet_url') ); ?>

Journal – Free wordpress Bootstrap theme

I have lunched a new free WordPress Bootstrap theme.
This theme is packed with features :

  • Using Bootstrap framework
  • Theme option panel
  • Video support
  • Widget ready
  • Language support
  • And best of all free to use

Here is the live theme demo

Download from Github https://github.com/maidulcu/JOURNAL.git

PHP Warning: Missing argument 2 for wpdb::prepare() after upgrading to WordPress 3.5

Are you getting wpdb::prepare() error on after upgrading to WordPress 3.5 ?

Don’t worry your website is not broken.

WordPress is just working you that your theme or plugin is not prepare to fight with hacker.

And your website is possibly expose for SQL injection vulnerability.

So how to stop this error and fix your website ?

A quick solve is to put

@ini_set('display_errors', 0);

on your WordPress wp-config.php. (Note: Hiding errors on production sites is good practice anyway.)

Now Here’s how $wpdb->prepare() is supposed to work:

$wpdb->prepare( "SELECT * FROM table WHERE ID = %d AND name = %s", $id, $name );

See how $id and %s is passed as a argument. This makes sure your query is safe.

And may be your code are like this format

$wpdb->prepare( "SELECT COUNT(*) FROM table" );

So you are getting error message

Please comment if you have any question

google cdn

Load jquery library from google CDN in wordpress

Add this code on wordpress theme functions.php to deregister the urgent jquery and load jquery library from google.

function load_cdn_jquery() {

    // only use this method is we're not in wp-admin
    if (!is_admin()) {

        // deregister the original version of jQuery
        wp_deregister_script('jquery');

        // discover the correct protocol to use
        $protocol='http:';
        if($_SERVER['HTTPS']=='on') {
            $protocol='https:';
        }

        // register the Google CDN version
        wp_register_script('jquery', $protocol.'//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', false, '1.5.2');

        // add it back into the queue
        wp_enqueue_script('jquery');
			
		
    }

}

add_action('template_redirect', 'load_cdn_jquery');

Removing extra p and line breaks from shortcodes in WordPress

Some time shortcodes add some some extra <p> and <br /> after of before post.This is happend because of the wpautop filter.

You can easily prevent this by changing the execution priority of wpautop filter.

Simply use this code on your theme functions.php

remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 12);

New Code to Display Latest Tweets

[highlight]The code below no longer works as-is with the Twitter API update to 1.1 as of 2013-06-11.Here’s a PHP way to interact with the new Twitter API.[/highlight]

Twitter recently deprecated the code that we using to display latest tweets

<div id="twitter_update_list"></div>
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/maidul.json?callback=twitterCallback2&count=1"></script>

So the above code will not work any more.
We have to use this updated code to get latest tweet

<div id="twitter_update_list"></div>
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="http://api.twitter.com/1/statuses/user_timeline.json?count=1&exclude_replies=true&screen_name=maidul&callback=twitterCallback2"></script>