Dynamic Web Lab

get post publish date outside the loop in wordpress

To get post publish date outside the loop in wordpress use the following code. [php] $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 />’ ; } [/php] Hope this code will help you. Thanks

Read More

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

Read More

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. [php] 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:’; } […]

Read More

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 [php] remove_filter( ‘the_content’, ‘wpautop’ ); add_filter( ‘the_content’, ‘wpautop’ , 12);[/php]

Read More

Remove Width and Height Attributes from wordpress content area

When you upload images using WordPress image uploader and insert it into your post/page, it will include the image width and height attribute in the tag.if you want to remove this automatic image width and height attribute from image, you can add this code to you functions.php [php] add_filter( ‘post_thumbnail_html’, ‘remove_width_attribute’, 10 ); add_filter( ‘image_send_to_editor’, […]

Read More
  • September 16, 2012
  • SEO

Best SEO Plugins For WordPress 2012

On my previous article for optimizing WordPress for seo i showed how some basic change on wordpress and installing some plugin can improve your website seo. Now i recommend to use WordPress SEO by Yoast along with those steps. This plugin have the following features : Page Analysis Technical WordPress Search Engine Optimization XML Sitemaps […]

Read More

Easy Press : Free WordPress Theme

Easy Press is a free WordPress theme.You can easily use this theme for your WordPress blog or for your news website.I make this theme using my BLANK RESPONSIVE HTML5 WORDPRESS THEME. It came with following features: [list style=”check”] HTML5 and CSS3 Theme Option Panel Custom Widgets Dynamic Footer widget area Have full control on Home […]

Read More

Add visitor browser name in the body class function

You can easily detect browser using this function and add visitor browser name in the body class function . Put this on your theme functions.php [php] add_filter(‘body_class’,’myfunction_browser_body_class’); function myfunction_browser_body_class($classes) { global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone; if($is_lynx) $classes[] = ‘lynx’; elseif($is_gecko) $classes[] = ‘gecko’; elseif($is_opera) $classes[] = ‘opera’; elseif($is_NS4) $classes[] = ‘ns4’; […]

Read More