prefix; $attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM " . $prefix . "posts" . " WHERE guid='%s';", $image_url )); return $attachment[0]; } endif; // ! _sf_get_image_id exists if (! function_exists('_sf_bg_img_size_decider') ) : function _sf_bg_img_size_decider() { if (! get_theme_mod( 'body_bg_choice' ) == '' ) { wp_enqueue_script('bg-decider', get_template_directory_uri(). '/js/screensize.js', array( 'historyjs' ), false, true); } } add_action('wp_enqueue_scripts', '_sf_bg_img_size_decider'); endif; // ! _sf_bg_img_size_decider exists /** * Responsive Image Thing * */ if (! function_exists('_sf_responsive_img') ) : function _sf_responsive_img($html, $post_id, $post_thumbnail_id, $size, $attr) { //make image links $attachment_id = $post_thumbnail_id; $default = wp_get_attachment_image_src($attachment_id); $size = 'fd-sm'; $small = wp_get_attachment_image_src($attachment_id, $size); $size = 'fd-med'; $med = wp_get_attachment_image_src($attachment_id, $size); $size = 'fd-lrg'; $lrg = wp_get_attachment_image_src($attachment_id, $size); //create image tag with queries $html = '