How to mark a image attachment as background image?

You could use the plugin “Custom Field Template” to replace standard custom fields with a much easier to use interface, that also allows you to use checkboxes, selects, textareas with tinymce, and file uploads among others. Then the client would just upload the image through that field and you use <?php $bg = wp_get_attachment_image_src(get_post_meta($post->ID, ‘custom_field_name’, … Read more

HTML in PHP problem [closed]

You get the error because you try to call php inside php. Try to use this snippet and see what is different: <?php if(get_field(‘post_image’)) { echo ‘<img src=”‘. get_field(‘post_image’) .'” />’; } else { echo ‘<img src=”‘ . get_bloginfo(‘template_url’) . ‘/images/images/default.jpg” />’; } ?> Also pay attention that bloginfo immediately prints value, when get_bloginfo returns … Read more

Resizing to bigger proportions as original not working

When you add the image to the post Select “Full Size” Click “Edit Image” Click the “Scale” button Manually edit the dimensions Save all changes Check to see if “Full Size” has your new dimensions Click “Use as featured image”

Image width issue in IE [closed]

The issue was related to width: 100%; being applied by WordPress to all images. The code below fixes this issue – i applied this only to IE 8 and lower, as these are the browsers that have issues with the code. img.size-full, img.size-large, img.header-image, img.wp-post-image { max-width: none !important; }

Get all first images of posts in same category

You can do this, and it isn’t that hard though could be a lot of work for the server. The code, a bit simplified, should look something like this: $cposts = wp_list_pluck($wp_query->posts,’ID’); // var_dump($cposts); // debug $args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ =>’image’, ‘post_status’ => ‘inherit’, ‘order’ => ‘DESC’, ‘posts__in’ => $cposts ); // … Read more

Custom Background Image per Page

You really just need to check the source. get_background_image() uses get_theme_mod(), which applies the theme_mod_{$name} filter. So… function alter_background($name) { // return something apporpriate for the theme mod } add_filter(‘theme_mod_background’,’alter_background’); Note: the “name” component may be different. Use var_dump(get_theme_mods()); to work out what you need.

How to get some information from the_content [closed]

You could initialize the video shortcode – – with the function do_shortcode. Exemplary usage would be like this: echo do_shortcode( ” ); Extra information: I have given an extensive answer to a similar question a couple of weeks ago. You should take a look I’m certain it will help you out. Especially if you still … Read more

Is there a WordPress Plugin like Imsanity that keeps high resolution originals? [closed]

Why do you need a plugin for that? Set image quality to 100% in WordPress with following code. function my_new_image_quality( $quality ) { return 100; } add_filter( ‘jpeg_quality’, ‘my_new_image_quality’ ); add_filter( ‘wp_editor_set_quality’, ‘my_new_image_quality’ ); Now when you upload a image, WordPress always crop your image for different thumbnail sizes but it also keeps orignal image. … Read more