0
votes
1answer
65 views

Featured Image URL is Showing but not thumbnail

I added posts from other CMS to my new word press site. For featured images I changed, wp_post table as post ID: 2300 Attachment in "wp_post": ID:3400 post_type: attachment post_mime_type: ...
0
votes
0answers
41 views

Remove link to post thumbnail in next_image_link() in single-attachment.php

I've added navigation to single-attachment.php: <div class="navigate"> <div class="previous"><?php previous_image_link( false, '&nbsp;'); ?></div> <div ...
0
votes
0answers
366 views

Set thumbnail from URL, by grabbing image in functions.php

So I've written a whole bunch of functions, which are used to display Vine videos. I then have a shortcode which outputs the code. The last thing I have to do is set the post thumbnail. I want to be ...
0
votes
1answer
607 views

How to find attachment by it's name?

Is it possible to get attachment id by its name? And at once may be it's possible to get parent post, to which this attachment is assigned?
1
vote
1answer
300 views

Delete all thumbnails for a post

I have a function that sideloads a YouTube thumbnail onto a page... but I want to remove the featured thumb on the page first (and remove all the various auto-generated sizes, too). I'm assuming I ...
1
vote
1answer
360 views

Exclude featured image from attachment loop

For my jigoshop theme I'm able to retrieve the images attached to my product post. However it pulls all images from both the featured image and my metabox images. What I'm trying to do is make it so ...
0
votes
1answer
119 views

How to attach images that I “insert from url” into the post?

I'm trying to get the list of images in my post, to display them in the front page... the problem is that when I add a new picture from a URL, it doesn't seem to attach it. $images =& ...
0
votes
1answer
431 views

Retrieve Image Attachments Getting Post Thumbnail Image First

I have written a funtion to get post image attachments, is there any way of ordering these images such that the first is always the post_thumbnail? Code below Thanks John function ...
1
vote
0answers
192 views

How to create resized versions of images added with wp_insert_attachment

I'm uploading images to my media gallery and setting them as my post's featured image, which is working quite well. I'd like to generate thumbnails of these featured images, in the same way that ...
0
votes
1answer
165 views

Import Dummy Content and Post Thumbnails

I am setting up a small dummy content plugin. What I would like to do is import several posts using wp_insert_post. Then I would like to import several images using wp_insert_attachment and then ...
3
votes
1answer
3k views

Set Featured Image Front Frontend Form

I have been struggling for days to figure this one out. I have successfully implemented a form to submit posts from the front end of my site. ButI can't figure out how to make the image uploads work. ...
1
vote
1answer
2k views

Insert an image into a post by API

By using the code below, I can create a new post and upload an image to wordpress's upload directory as a attachment through a form's submitted data. $new_post = array( 'post_title' => ...
2
votes
1answer
105 views

Converting Attachment to Images?

I've had no problem using lightboxes before with attachment images, but I've switched to a new theme called Quicknote and it seems that attachment images now instead link to the attachment page. ...
0
votes
1answer
159 views

is it possible to force wordpress to always save thumbnails as 'jpg' not 'png'

I cant see any settings and cant see much in the php api docs regarding this? for instance if the original file upload is a png wordpress converts to jpg
5
votes
4answers
4k views

Get first image in a post

I am using this code directly from the codex. function echo_first_image ($postID) { $args = array( 'numberposts' => 1, 'order'=> 'ASC', 'post_mime_type' ...
2
votes
4answers
20k views

How to Fix HTTP Error When Uploading Images?

I am using WordPress 3.4.1 on Ubuntu 12.04 using Apache and PHP 5.3.X When I login to the dashboard and add a new post. Then try uploading an image to set as a featured image, I get a red box with a ...
1
vote
1answer
721 views

Image still attached to post even after removing it as featured image

I'm sorry if this is too noob of a question, but when I upload an image and set it as the featured image then later remove it (as featured image), the media list still shows it's "Attached to" the ...
0
votes
1answer
596 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 ...
1
vote
1answer
887 views

why when I try to insert an image attachment along with a post does wp_get_attachment_url give me a very wrong file path?

I am using a new blog on WPMS (3.0.1, updating is not an option) to aggregate posts (and their featured image) from a few blogs on the same install, and I have to do it programmatically rather than ...
1
vote
2answers
993 views

Show Multiple Size URL of one Featured Image/Thumbnail?

Is it possible to print two different url's from the same featured image/thumbnail? So i have set up my image size.. add_image_size( 'full-size', 460, 9999 ); add_image_size('fixed-height', NULL, ...
1
vote
2answers
1k views

How do i show wordpress attachments from current post?

So with my blog i have a photo attachment page but it only shows to photo's at a time, and those two photo's are used as the navigation and i hate that. I want the attachment page to show all the ...
2
votes
1answer
352 views

Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory

I have a bunch of old posts on a blog that I would like to assign a featured image to. I have retrieved all the images I would like to use for each post. I saved each image file name after the slug ...
0
votes
2answers
136 views

Moved server, and WP now uses original images for all thumb sizes?

I just moved servers. When calling wp_get_attachment_image() or any of its sister functions the image returned is always the full-size image, scaled down, instead of the requested thumbnail size. ...
0
votes
3answers
2k views

How can I get a different image size, if all I have is the link?

For various reasons, I can't use Wordpress' built-in Thumbnail functionality. What I want to do instead is to use the first image in the post as the thumbnail. Here's what I found in the codex: Show ...
0
votes
1answer
1k views

Get all images from posts with maximum number and without featured image

I recently asked a question on how to get all images from all posts - and I got a working answer, but unfortunately the code gets post-thumnbnails as well, and I didn't find a way to limit the number ...
2
votes
1answer
2k views

get_the_post_thumbnail() doesn't taking style attribute

This seems to be an easy one but its giving me quite a hard time. get_the_post_thumbnail() suppose to take attribute as an array. Well, everything working right but when i pass style attr its doesn't ...
0
votes
1answer
721 views

Set (featured) thumbnail for post?

I'm using wp_insert_post and media_sideload_image to create a post and attach a single image to the post. However, how can I mark this attached image as featured thumbnail? It would make listing the ...
4
votes
2answers
2k views

Delete original image - keep thumbnail?

I'm using a lot of thumbnails but never the original file. To save space, I'd like to prevent the original from being saved on disk but only keep a thumbnail of 100px. How can I do this? Thanks, ...
3
votes
1answer
2k views

media_sideload_image generates blank?

I'm creating a custom post form that is supposed to take an external image and uploads it to the media library and attach it to that post. This should be possible by using media_sideload_image, but ...
3
votes
1answer
2k views

Programatically creating image attachments from local URLs and setting featured image

I'm currently working on importing an MovableType blog into WordPress. The blog has several thousand posts, and each post has an image associated with it. The export file contains references to each ...
5
votes
1answer
2k views

Programmatically get images by URL and save in uploads folder

I am involved in a large migration from another CMS to WordPress. We have a copy of the database and have worked out how to extract the content and programmatically create WordPress posts from it ...
3
votes
2answers
518 views

how to test for attached image

I am trying to find out whether or not a post has images. If it does, I then want to know if a featured image was specified for the thumbnail - if not, the get_thumb() function will assign an image ...