1
vote
1answer
30 views

How to add a class to the attachment images

When I'm in the Wordpress editor and I add an external image with the 'img' button, my html result wil be like this: <img src="http://example.com/image.jpg" alt="image" /> How can ...
3
votes
9answers
267 views

disable WP automatically inserted line breaks after an image

I've set medium sized images to a custom size which should allow for both of the images to align horizontally within the post. (The full post width is 880px, medium images are set to 413px.) My ...
0
votes
0answers
107 views

Create thumbnail on PDF upload with Gravity Forms

I'm working with some great code that was provided recently to create an image thumbnail from a PDF upload, and I'm now trying to implement this in the functions file so that it can be applied to any ...
6
votes
4answers
310 views

Add image size if page template

I'm building a members website with WordPress Multisite. Is it possible to restrict how many images are being generated depending on the selected template? I have tried the following lines of code ...
3
votes
1answer
149 views

Auto delete WordPress images/thumbnails (all sizes) and featured after X days/hours, or similar?

I am looking for solution to auto delete images of old posts in WordPress site. I want to hold images of current 50 posts, others should be deleted automatically. It can be function to delete on time ...
0
votes
0answers
37 views

Slider Issues using MetaBox Plugin

I'm just now joining a previously launched project. The home page slider is a custom meta_box type from the MetaBox plugin. Here is the code to add the fields. $meta_boxes[] = array( 'id' => ...
1
vote
2answers
202 views

Programmatically Set First Image as Featured

I have over 400 posts with images inside them, I have got a new template which requires a featured image for each post, something my last template did not require... I am wondering if there is a ...
0
votes
0answers
56 views

Set Featured Post Automatically - First Image included IN the post

I want to set the featured image to the first image IN the post content. I've come across a few functions that grab the first image attached to the post. Sometimes a user will add an image to a post ...
0
votes
1answer
41 views

Retrieve First Image Function

I am using this function to retrieve the first image from a gallery in a post. However this doesn't work properly when I re-order the images in the gallery. It is stuck with the first image at the ...
0
votes
1answer
118 views

Dynamically adding Captions to images

I have a site where the author has included Amazon Affiliate links. They've done this by adding the URL to product images. I'm wondering if there's a way to add a function that will automatically add ...
1
vote
2answers
486 views

Remove images from get_the_excerpt

I'm using a custom function to create a shortcode that displays the latest blog post on the home page of a template. But I'm trying to NOT have it display any images. I know I can use the Advanced ...
3
votes
1answer
2k views

How to create thumbnails for PDF uploads?

I'm developing a website that needs to allow users, within Gravity Forms, to submit a PDF file and have a JPG thumbnail created of the first page of the PDF that is then displayed in the created post. ...
-1
votes
1answer
33 views

add if statement to the featured image

I have a featured image. I want to add an if statement to the size. For example, if the featured image height exceeds 500px I want to add something. Is that possible ?
0
votes
1answer
21 views

Custom Image Size in Insert Media

I have some custom image sizes set in my functions and it works just as one would expect, but I am would like this custom image size to be present when a user adds images to a post. You know when you ...
0
votes
0answers
88 views

All “Featured Images” not displaying after Wordpress update

After updating to the latest version of WordPress today, I noticed that all "Featured Images" on my website are no longer displaying. After trying to figure the problem out for hours, I added the ...
0
votes
1answer
254 views

Random Featured Image Based on Category

I am looking to extend the below code to select a random featured image based on a specific category. The below works but uses an overall list of images to pull from vs a list of images based on ...
0
votes
0answers
98 views

What code do I use in the functions php file to make an image auto update in a container box?

Is there a way to make an image autoupdate in a container by using code in the functions php file? This is probably a dumb question and I'm probably not asking it right. Basically, I want a box above ...
0
votes
0answers
187 views

Full size image option removing problem

I have removed the Full size image option from the media upload window see Code: function theme_t_wp_set_image_size_options( $sizes ){ $sizes = array( 'thumbnail' => 'Thumbnail', ...
0
votes
2answers
188 views

Function to get thumbnail img source

I have this function call that displays an entire img tag with the correct url for that post.. the thumbnail img... ?php the_post_thumbnail('blog-page'); ?> What I need is just the source ...
2
votes
1answer
1k views

Images uploaded using media uploader are appearing upside down

A client of mine has come to me with an issue I've never seen before. Some of the images he's uploaded via the media uploader are appearing upside down or sideways. I'm assuming it's because they ...
1
vote
1answer
78 views

media resize/crop possibilities?

Under admin panel -> media settings there are no minimal width option for thumb or other image modes ex: I would like to crop image widthout distortion -> height 124px and minimum-width 124px and ...
-1
votes
1answer
116 views

Image width issue in IE [closed]

For some reason images are being displayed as a thin line in IE 8 and earlier and i cannot work out why this could be. I'm using CSS to re-size the images for the homepage, the reason for me using CSS ...
0
votes
2answers
442 views

Featured Image keeps cropping

I've spent hours trying to figure this out and its driving me mad. I'm not great with php code so I'm not sure if I'm doing this the best way anyway... It should be simple - I have built a custom ...
0
votes
1answer
168 views

Adding a 'style=' bit to image_send_to_editor output

The best thing I liked about the new v3.5 media manager was being able to insert images to a post hosted by an external site like photobucket using "Insert from URL". I normally format my image ...
2
votes
1answer
56 views

Actions according to image type and size

I want to do some actions according to image type and size, but the script I'm using is kind of heavy and is skyrocketing my wait time (first byte) from 5 to even 40 seconds (usually it's bellow a ...
0
votes
1answer
187 views

Conditional function for excluding first image from content, not working

I have the following function: function remove_images( $content ) { if( ( is_category() || is_archive() || is_home() ) && has_term( 'MyCat', 'category', $postID ) ) { $postOutput ...
-1
votes
1answer
165 views

Convert all uploaded PNG files to PNG-8 format

Running a high trafficed platform. In my quest to minimise bandwidth costs, I added a high JPEG compression on all JPEG uploads (check solution in my previous question). However, Wordpress does not ...
1
vote
1answer
316 views

Add custom image sizes to media uploader

I want to add custom image sizes to the media uploader: In order to do this, I use the following code (comments are there for convenience): // this function adds the custom image sizes to the ...
4
votes
2answers
1k views

Set JPEG compression for specific custom image sizes

I use various custom image sizes (by add_image_size) and I have set my JPEG compression to 30% with this filter: function jpeg_quality_callback($arg) { return (int)30; } add_filter('jpeg_quality', ...
4
votes
2answers
488 views

Removing default image size list in Media Box

I trying to remove unused image size (Thumbnail, Medium, Large) in MediaBox Any function can i use in functions.php ? or some trick ? PS : I know i can use jQuery trick but any better function to ...
0
votes
1answer
489 views

Saving/Writing/Adding file to upload folder

Within a plugin I am generating an image, I would like to save this image to the upload folder and update the WPDB with the location of said file. I cant find any build in wordpress functions to ...
0
votes
2answers
247 views

Wordpress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?

I wonder if Wordpress is the best CMS or solution for what I wannt to do? I need to find some way to upload images to a post that I can loop as background images. Just like I can upload multiple ...
2
votes
2answers
1k views

How to register images uploaded via FTP in media library?

I'm using my own upload.php file to upload images to: $upload_dir = wp_upload_dir(); $targetDir = $upload_dir['path'].'/'; It works like it should with this exception that images uploaded to ...
0
votes
1answer
64 views

Allow authors to create article image

I want to allow contributors to upload images while creating posts. But the catch is, I am building the post display pages out of my own custom PHP. Every article written will follow the same ...
0
votes
2answers
303 views

get_image_tag() html output : empty src attribute

I'm trying to use the get_image_tag() function to alter the html output of an image, like so : add_filter('get_image_tag', 'kh_image_attachment', 10, 5); function kh_image_attachment($html, $id, ...
0
votes
1answer
727 views

How to make excerpt image be full size instead of thumbnail?

Now when I have excerpts on the home page the image is a small square, but I'd like to change it to a fill the entire width of the content area. (as if the image was in a post.) My theme is responsive ...
-5
votes
1answer
132 views

MIssing feature image link function

I need to be able to add a feature image to a post as a link. The link is good, it's green check. And no i cannot upload the file and insert into post dont do anything good. I have the link to the ...
0
votes
2answers
288 views

How to only publish posts with image in it

I use a standard loop in my index.php and that shows all the posts beeing posted. What i'm looking for is a code that only shows the posts that have image(s) in it. With other words: i only want to ...
0
votes
1answer
578 views

How to hide image-url if no attachment?

How can I hide the img-tag if there is no attacment? (function is from this tutorial: http://wp.tutsplus.com/tutorials/automagic-post-thumbnails-image-management/) <img src="<?php ...
2
votes
2answers
383 views

Converting a simple plugin to be placed inside of functions.php

First off, I know it's better practice to use plugins separately than to integrate them in functions.php but this is for a theme framework that will be deployed to multiple sites and it will be easier ...
1
vote
1answer
78 views

Publish/Update post is changing image links from file url to post url

I've written a filter to wrap images included in posts with figure tags and their captions with figcaption tags. I turned off the visual editor so that it doesn't strip out all the html from the ...
5
votes
1answer
4k views

remove links from images using functions.php

I am looking for a way to remove the attachment link from images in the post content. I would like to add this to the functions.php in my theme. I know you can disable this in the post on a per ...
1
vote
1answer
98 views

Featured Image Thumbnail Creation

What function or script creates the hard-cropped feature image when a post is saved? Regardless if I stipulate a size when saving the featured image in the media library (like the medium size), a new ...
2
votes
2answers
525 views

Best way to programatically add “rel” attributes to page and post images

For single posts and pages, I would like to add certain rel attributes to all the images on the contained therein added with the "Add Image" functionality on the edit screen. The attribute would be ...
0
votes
2answers
361 views

Need To Resize Images Exactly Without Losing Image Details

I am working on a Wordpress site that heavily uses image uploading and whatnot, I have defined the image sizes in my functions.php and I have hard crop mode turned on which ensures that my images are ...
1
vote
2answers
551 views

Twentyten Child Theme: header images display messed up in admin panel

WordPress v 3.0.4 multisite-network enabled, local installation w MAMP 1.9.4, PHP 5.3.2, Theme: Twentyten child TWO PROBLEMS: 1) Display of header image thumbnails in admin panel and 2) path to ...
0
votes
2answers
400 views

fetch images and videos

Is it possible to fetch videos and images of a particular website and put it into post? i mean i am thinking of writing a function, where i will just write the website name, and then with the help of ...