Calling two images at a time? A better way?

Yep – it is pretty inefficient. Here is a rewrite: <div id=”engagement”> <?php $images = new WP_Query( array( ‘post_parent’ => get_the_ID(), ‘post_status’ => ‘inherit’, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘order’ => ‘ASC’, ‘orderby’ => ‘menu_order ID’, ‘offset’ => 0, ‘posts_per_page’ => 6, // show six images total ‘update_post_term_cache’ => false, ) ); $count = … Read more

Some images on WordPress site are suddenly gone

You are using relative URLs in some places. That is, you are using this– <img src=”https://wordpress.stackexchange.com/bruce_lipton1.jpg” />— instead of this– <img src=”http://www.pureplantessentials.com/bruce_lipton1.jpg” />. Don’t do that. Relative URLs are very unreliable in most of WordPress. It has to do with the way that WordPress rewrites URLs. Your theme, for example, is at wp-content/themes/theme-name/ but those … Read more

Upload images – Theme options

I can’t comment on your code, but you might find this link useful: Options Framework Theme: http://wptheming.com/options-framework-theme/ This is something you have to edit carefully, but it has pretty much every type of control you can think of in there. It also had the only working MCE Editor that I could find. I wanted that … Read more

Image upload and path to custom field

Found the solution. Forgot 2 lines of code. New is line 2 and line 11. I post the complete code: if( ‘POST’ == $_SERVER[‘REQUEST_METHOD’] && !empty( $_POST[‘action’] ) && $_POST[‘action’] == “new_post”) { $file=$_FILES; // Funktion zum Image-Upload, falls sie noch nicht existiert if ( ! function_exists( ‘wp_handle_upload’ )) { require_once(ABSPATH . “wp-admin” . ‘/includes/image.php’); … Read more

Adding a ‘style=’ bit to image_send_to_editor output

I can’t find the proper hook, but there is alternative solution: to add style=”float:right” to all images in content, which have class=”alignright”: add_filter(‘the_content’, ‘my_add_image_float_right’); function my_add_image_float_right($content) { $pattern = ‘@(<img.+)(alignright)(.*)(/>)@Ui’; $replacement=”$1$2$3 style=”float:right” />”; $content = preg_replace($pattern, $replacement, $content); return $content; }

Resize uploaded images [duplicate]

I use a plugin called AJAX Thumbnail Rebuild. It goes through all of the images in your media library and re-sizes them based on any image sizes registered (including the defaults and anything added with add_image_size()). It only runs when you manually request it and you can tell it to only rebuild certain sizes if … Read more