Facebook Debugger – Bad Response Code: URL returned a bad HTTP response code : 404

I faced a issue with one of my clients sites after migration. The facebook debugger was returning http response code as 404 , even though the webpage was loading fine. No issues with meta tags. After hours of research its the htaccess file which was creating the issue. The site […]

Read More

Fetch the first image from the post

April 26, 2013 |

We can grab the first image from the post content using the below function. function fetch_first_image($id) { $p = get_post($id); $first_img = ”; ob_start(); ob_end_clean(); $output = preg_match_all(‘//i’, $p->post_content, $matches); $first_img = $matches [1] [0]; if(empty($first_img)){ $first_img = “/images/default.jpg”; } return $first_img; } Under template use the function like below […]

Read More

Grey background in tinymce wp_editor function

April 26, 2013 | ,

I faced a weird issue when adding wp_editor to a metabox in post. The visual mode was showing a weird grey background and there is no way you can overwrite using a css directly. After some research i figured out that adding a admin css with code body.mceContentBody { background-color:#FFF […]

Read More

prettyPhoto Live Event with ajax loaded content

November 22, 2012 | , ,

Prettyphoto is a wonderfull gallery plugin but when used with ajax loaded content it didn’t work with newly loaded images from ajax request into the dom. Even though there are many solutions posted in internet none seem to work as expected. So after playing around a while i found a […]

Read More

Bootstrap Ajax model popup not working

November 22, 2012 | , ,

For some reasons the bootstrap model box was not loading ajax content. I was trying this is wordpress and having a hard time fixing the issue. With some research i found the solution. <!DOCTYPE html> <html lang=”en”> <link href=”bootstrap/css/bootstrap.css” rel=”stylesheet”> <link href=”bootstrap/css/bootstrap-responsive.css” rel=”stylesheet”> <script src=”bootstrap/js/jquery.js”></script> <script src=”bootstrap/js/bootstrap.js”></script> <a href=”<?php echo […]

Read More

Woocommerce payflow gateway

September 5, 2012 | , ,

I had the opportunity to build the payflow extension based on woocommerce for one of my client. If you are interested please email me

Read More

Add new Plugin requests for FTP info in localhost

September 4, 2012 | , ,

I faced a issue recently when i tried to install a plugin using plugin installer. It was asking for ftp details which sucks!. So i tried options like changing file permissions etc, but nothing helped. With a quick research in google i found the option define(‘FS_METHOD’,’direct’); which should be added […]

Read More

Wp ajax call returns 0 at the end

August 23, 2012 |

To any wp ajax call add_action(‘wp_ajax_my_action’, ‘my_action_callback’); function my_action_callback() { //Do action // echo ‘My ajax action’; die(); } Don’t forget to add the die() at the end of ajax function to avoid 0 with the results.

Read More

WordPress – Get Attachment Id through Image url

August 23, 2012 |

There are many cases we might require the attachment id using the image path. Use the below function in functions.php of theme. function kd_get_attachment_id($image_url) { global $wpdb; $prefix = $wpdb->prefix; $attachment = $wpdb->get_col($wpdb->prepare(“SELECT ID FROM ” . $prefix . “posts” . ” WHERE guid='” . $image_url . “‘;”)); return $attachment[0]; […]

Read More

Wp editor in custom meta box

August 1, 2012 | , ,

Before Wp 3.2 any textarea can be changed into a tiny-mce editor by adding the class =’theEditor’ But in recent versions it didn’t work as expected. So after lot of search i found that WP have included a new function to convert any metabox to editor. the arguments are $content […]

Read More

Wp pinterest integration in a blog posts

August 1, 2012 |

The pinterest requires a script which needs to be added to the footer. So in wp we can either use a action to call in footer or use the script tag directly in footer.php This will initialize the pinterest. To link any featured image in a post or page paste […]

Read More

Wp Autosave clears post meta fields

August 1, 2012 |

I came across this issue recently where the post meta field is cleared when a auto save draft or ajax request is made. There is a workaround for this under the function which is linked to action ‘save_post’ we need to add few lines of code Add this lines inside […]

Read More
Page 2 of 3123