Add image custom attribute [closed]

You need to use the hooks attachment fields to edit / save to ad and save the fields. function add_attachment_field_credit( $form_fields, $post ) { $form_fields[‘paper-type’] = array( ‘label’ => ‘Paper type’, ‘input’ => ‘text’, ‘value’ => get_post_meta( $post->ID, ‘paper_type’, true ), ‘helps’ => ‘Photo paper type’ ); return $form_fields; } add_filter( ‘attachment_fields_to_edit’, ‘add_attachment_field_credit’, 10, 2 … Read more

Stop underlining image links

By definition it isn’t really hyperlinked image. It is hyperlink tag a that contains image tag img. Most probably it is a link that is really underlined, image is just inside it. You need to create new CSS rule that matches your link with image and specifies no underline (it could also be border-bottom property … Read more

Are image addresses security relevant?

You’ve asked a good question… well, a couple of questions. Considering the example at face value. Larger sites have an image url like this. Why? . <img src=”https://wordpress.stackexchange.com/questions/315533/imgrur.com/9keqqq”/> There are any number of reasons but let’s deal with the most obvious. “Imgur” is an example of a service that hosts “interesting” images and they encourage … Read more

Get single image from custom fields made with WCK custom fields creator

Here is the code that worked. I had to get rid of the foreach loop and reference the array directly: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); $productimgs = get_post_meta( $post->ID, ‘productimg’, true ); $image_color = $productimgs[0][‘product-image-color’]; $image_bw = $productimgs[0][‘product-image-bw’]; $imgclr = wp_get_attachment_image_src( $image_color, ‘grid-large’ ); $imgbw = wp_get_attachment_image_src( $image_bw, … Read more

How do I return an image from a script

Fatal error: Call to undefined function __() in /homepages/5/d367772185/htdocs/rodandfly/wp-admin/includes/file.php on line 13 Where is your code? file.php is expecting __() to be defined which it should be if your loading it from within an activated plugin. The best way to do what your trying to do is use either media_handle_sidelaod() or media_sideload_image() which will cause … Read more