Just use following code the check for image in wordpress post. Copy paste the following function in functions.php file. function check_image(){ $content = $post->post_content; $all_images = ‘~<img [^>]* />~’; preg_match_all( $all_images, $content, $pics ); // Check to see if we … Continue reading
Monthly Archives: February 2010
How to get the first image thumbnail from the wordpress post using wordpress
Most WordPress theme are using custom fields to display thumbs on their blog homepage. But you can take easily extract the first image from the post, and display the image as post thumbnail. Just copy paste the following function in … Continue reading
Put Google Analytics code into your wordpress theme using wordpress hook
Copy paste following lines to your wordpress theme folder’s functions.php file. Dont forget to replace your google analytics code in google_analytics code. have fun! Incoming search terms:javascript dashboard
Change the WordPress login logo using wordpress hack
Copy paste following lines to your wordpress theme folder’s functions.php file. function change_login_logo() { echo ‘<style type=”text/css”> h1 a { background-image:url(‘.get_bloginfo(‘template_directory’).’/images/logo.png); } </style>’; } add_action(‘login_head’, ‘change_login_logo’); have fun! Incoming search terms:hack wordpress loginlogin css
Add a favicon to your WordPress theme using wordpress hack
Just copy paste the following following lines to your function.php file. function add_favicon() { ?> <link rel=”shortcut icon” href=”<?php echo bloginfo(‘stylesheet_directory’) ?>/images/favicon.ico” > <?php } add_action(‘wp_head’, ‘add_favicon’); if wp_head() function added in your header.php file, If that function not added … Continue reading