Tagged Questions
0
votes
0answers
15 views
Add to the library a media from a subfolder
I'm trying to upload some media to the media library in a "uploads" subfolder. The problem is that the media is added, I can see a new entry in the media library, the database the guid of the file ...
2
votes
1answer
27 views
Theme Customiser Image Control
I'm aware that one can add a control to the theme customiser to add an image.
This control returns an image URL however, and I need its attachment ID, not the image URL. Where can I intercept or ...
0
votes
1answer
42 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 ...
0
votes
0answers
31 views
Custom post types images go to a specific folder, not the montly one
I have a website which allows "mini sites", meaning custom post types.
We noticed that the images that are published along the mini-sites reviews go automatically to the same month, while regular ...
0
votes
1answer
41 views
Upload unnattached image from frontend
I am using the below function to let users upload files from the front end. It works great except that I would like the file to NOT be attached to any post. Currently, the file is automatically ...
-1
votes
1answer
36 views
How to link images of one WP site to another WP site?
My first site is having 92 categories to display more than 10,000 SMS. Now I want to insert random images to all my posts (SMS) from my other site which is having images as per my categories in SMS ...
1
vote
1answer
49 views
Rename attachments during upload
Here's the function I use for WP to rename images during upload on the fly and set the image's filename to match the post slug.
function wpsx_5505_modify_uploaded_file_names($arr) {
// Get the ...
1
vote
3answers
109 views
Out of memory error reporting
When users upload very large photos and memory is tight, it seems like Wordpress runs out of memory - fails to resize the uploaded photos and does not create the necessary metadata ...
0
votes
1answer
30 views
Image attachement management - a philosophical question
I'm building a theme which includes displaying images which are not embedded in the body of the post by the user.
I understand the correct approach to this is to use the concept of attached images - ...
0
votes
0answers
17 views
wp insert attachment from local drive [duplicate]
Is there some way to upload images from local drive to posts without using dashboard.
Something like function wp_insert_attachment, bur for that function is a rule that files must be on server.
0
votes
1answer
181 views
wp_get_attachment_link() add rel attribute if the link points to direct image
I'm using filter like this to add rel attribute in wp_get_attachment_link()
add_filter( 'wp_get_attachment_link', 'sant_prettyadd');
function sant_prettyadd ($content) {
$content = ...
0
votes
5answers
260 views
Timthumb alternative [closed]
I want to generate resized images on the fly. Basically I'm creating a plugin that allows the user to set a default image that gets displayed on the front end. He also has an option to change the size ...
0
votes
1answer
285 views
Why can I not view image attachment pages?
I have a problem with images.
I can see my uploaded images, as previously, through the media library. I can access each image by clicking on "edit". But if I then click on "View Attachment Page", I ...
2
votes
2answers
120 views
Correct Way To Show Custom Taxonomy for Image Attachments on Template File
I've created a custom taxonomy called imagetags using the following code:
// Register Custom Taxonomy
function custom_imagetags_taxonomy() {
$labels = array(
'name' => _x( ...
1
vote
2answers
80 views
How can I attach hotlinked images in posts/pages within the same server?
Not sure if this makes sense but I'm trying to attach hotlinked images to their posts/pages with no lucky, most plugins such Cache images works ok but only to external domains, I need to auto-attach ...
1
vote
1answer
117 views
Multiple images in one attachment page
I want multiple images for one post attachment page, but there is no option for that. How can I do that?
0
votes
1answer
120 views
Use full size images in a specific gallery
Thumbnails are displaying as 100px however the full size is 130px which is what I want.
I want this only in one specific gallery.
Also would like to link each gallery thumbnail image to an external ...
0
votes
2answers
124 views
One picture belonging different galleries?
How can one picture belongs different galleries?
For example, there are two galleries. I want to avoid loading the image twice (in two galleries) but it shown (included) in the first and second ...
0
votes
1answer
567 views
How can I hide media library images from general users?
As an admin I really like the features and functionality of the WordPress 3.5 media manager.
With a multi-user site however all users can see all images in the media library - whether uploaded by ...
1
vote
2answers
233 views
Change code to display image attachment page
I have this code which displays images with their captions in a list.
On clicking caption, opens image in an attachment page, but clicking on image, opens that image with a dark-gray background. Is ...
0
votes
2answers
366 views
Get an image from url in front end submission form
I am building a user generated content sharing theme
so how can i allow visitors to upload an image from a url
i mean to say that they enter the url and the image gets automatically attached
this is ...
1
vote
2answers
114 views
Wordpress Image Attachment using remote image
Is it possible to use remote image as wordpress attachment?
* Not stored on our server..
How about the code/script?
i see that attachment is act as post in database..
seems it's possible.
UPDATE
...
1
vote
1answer
546 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' => ...
1
vote
2answers
133 views
Allowing post attachments without allowing to insert in text
Is there a way I can allow the user to attach images as attachments to a post without allowing him to insert them within the text itself? Ideally the Upload Media button remains the same but the image ...
0
votes
1answer
65 views
Random Characters in the end of every image url in post
I am having this strange issue, whenever a post is published the images url gets random characters in the end. i have checked teh functions.php but didn't find anything related. here is an example :
...
0
votes
1answer
209 views
Possible to add “Even/Odd Classes” to image attachments via wp_get_attachment_image?
Im looking for a way to add an alternating even/odd class directly to each image attachment when its outputted via my function below:
<?php
function nongallery_img_slide( $post_id = null ) {
...
1
vote
1answer
370 views
How to remove title attribute from gallery links and images
I want to remove the title attribute from within the output of a [gallery] shortcode e.g.
<a href="url" title="bobby">
<img src="url" title="bobby"/>
</a>
should be:
...
1
vote
0answers
56 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.
...
1
vote
0answers
51 views
Regex to turn embedded images in to attachments
I've got a blog that has all images embedded in each post rather than a thumbnail linking to an attachment page which is what I'd like.
I understand from this question that no plugin (like Regenerate ...
0
votes
2answers
105 views
Re-process Images
I've got a blog that has the highest-resolution version of all its images embedded in the posts, rather than a thumbnail linking off to an image attachment page.
Can you tell me how I can re-process ...
1
vote
1answer
75 views
media_sideload_image with rewritten urls?
When I try to use media_sideload_image with a path like this http://placekitten.com/300/200, it gives me an error.
That is because it don't know the filetype or the filename. Best way to upload the ...
2
votes
1answer
155 views
query attachments of parent page if attachments of current page are smaller than …
I'm using WPQuery and get_children($query_images_args) to query attachments from the current page. If the current page has no attachments assigned I'm querying the images of the parent page.
This ...
2
votes
1answer
430 views
query attachment images … if no attachments -> get attachments of parent page?
I use this to query all attachments of the current page or post I'm on …
$query_images_args = array(
'post_type' => 'attachment',
'post_mime_type' =>'image',
'post_status' => ...
1
vote
1answer
2k views
get images attached to post
I want to have the ability to use pictures from the media library in a jquery slider on the home page so that it's easy for someone else to update the pictures without having to hardcode it. I have ...
0
votes
1answer
469 views
WP_Query: attachment image in “full” size?
I'm using the following script for my current project.
$query_images_args = array(
'post_type' => 'attachment',
'post_mime_type' =>'image',
'post_status' => 'inherit',
...
2
votes
3answers
1k 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' ...
0
votes
1answer
619 views
wp get attachment image always gives me thumbnail
I have an image which should be output on the page. The space is limited (width-max = 209px). Now I have to provide the image in a scaled size, if the user doesn't do it.
This is my code:
$src = ...
0
votes
2answers
79 views
greater flexibility in targeting images attached to page
Right now I have several images attached to my page, but I only want four of them to display in a slideshow, and then the other ones are referenced within the page's visual/html box. The problem is ...
1
vote
1answer
79 views
Add attachment for all images in post
I want to move someone else's WordPress blog to a new server. I only have access to the exported XML file of the blog. When importing the XML with the Wordpress Importer plugin, everything went fine ...
1
vote
1answer
321 views
Custom page template to display all image attachments
I am tryin to insert all pictures in media to page. By meaning all pictures, everything added in blog. I ve been looking this feature all day. Is there any shortcode for that or something easy to make ...
0
votes
1answer
113 views
Excluding post thumbnail from the attachment.php when using wordpress gallery
I am looking for this answer everywhere and can't find it.
I setuo the wordpress default gallery using the attachment page which shows next and previous photos.
everything is working fine and I have a ...
1
vote
1answer
164 views
How would one change the default url structure of attachments?
When I click on post images it redirects in a page with a url like this: http://localhost/?attachment_id=897. Can I set the default image link like http://localhost/wp-content/uploads/2012/05/dice.jpg ...
1
vote
1answer
435 views
Link Featured Thumb to Attachment Page, If Possible
Are featured thumbs uploaded the same as other images and have their own attachment post url?
I'm trying to utilize the 3.0+ post formats and am using the featured image when creating a post under ...
-2
votes
1answer
55 views
How can we see which posts don't have a featured image or it doesn't exist anymore?
Which plugin or code I need to make it show me a list with the posts that don't have featured image or is broken(the featured image doesn't exist anymore)?
0
votes
1answer
342 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
2answers
205 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
3answers
2k views
use wp_get_attachment_image() to show attachments
I really hope this is a facepalm moment, b/c i'm getting frustrated with this. Making a quick loop to show certain attachment images. lifted it almost straight from the codex but ...
1
vote
1answer
200 views
Exclude images from “inserted into post” when trying to get attachments
I have here the coin-slider which takes all pictures from the gallery. I get the attachments through the following code:
$attachments = get_posts(array('post_type' => 'attachment', 'post_parent' ...
0
votes
1answer
492 views
Post Gallery list attachments except the one used as post thumbnail
I'm doing gallery in a single post after the post thumbnail. So I list all the post attachment with the image type (with the following query) but I want to exclude the post thumbnail.
global $post;
...
1
vote
2answers
894 views
Find the post an attachment is attached to
I have a list of attachment IDs which are built using this array:
$all_images = get_posts( array(
'post_type' => 'attachment',
'numberposts' => -1,
) );
Is it possible to take the image ID ...
