WORDPRESS

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. [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

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 …

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

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

Load jquery library from google CDN in wordpress 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]

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 [php] <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> [/php] So the above code will not …

New Code to Display Latest Tweets 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’, …

Remove Width and Height Attributes from wordpress content area 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 …

Easy Press : Free WordPress Theme 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’; …

Add visitor browser name in the body class function Read More »