Questions tagged [attachments]

An attachment is an image or other file uploaded through the post editor's upload utility. Attachments can be displayed on their own 'page' or template. For more information, see Using Image and File Attachments.

Filter by
Sorted by
Tagged with
0
votes
1answer
2k 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 = preg_replace("...
0
votes
1answer
91 views

dynamically get post attachment while editing

I want to show a meta box on the post edit screen, that contains a list of the images attached to the post. I need the meta box to work for new posts as they are being created. It should update ...
0
votes
2answers
266 views

How to create an identical second loop for attachments?

I have one loop for big images, and I need the same loop with small images (thumbnails). This is where I am stuck. Use case: I am trying to implement the elastic image slideshow jQuery plugin with ...
0
votes
1answer
97 views

Create a permalink for a post's attachments

I'm trying to create a custom permalink structure. I'd like to have a custom page which displays each post's image attachments, using the following structure: www.mysite.com/hello-world/images If ...
0
votes
1answer
157 views

Showing the attachment for a page?

I have the following function, it displays the attachments of a post, however it shows the full size, how can i show a limited number of attachments and also a smaller version like a thumbnail. ...
0
votes
1answer
137 views

How to wrap this Link with an Image?

im working on default wordpress theme twenty eleven, i just wanted to know how can i wrap this previous and next anchor with an image or next/previous button? <span class="nav-previous"><?...
0
votes
3answers
264 views

WordPress Attachments vs Post Meta

Apologies if this is not a question and belongs more in discussion, but In dealing with image attachments for a portfolio site, what is the benefit to having images be "attached" to a post versus ...
0
votes
1answer
34 views

Post Attachment missing head (stylesheets/js/what-not)

I am using a modified 2011 theme, I got the single post to look fine but my single attachment is not working. I'm told this will default to the page.php if I do not have an attachment template. So, ...
0
votes
1answer
252 views

Loop issues when creating custom query for media uploader

I'm working on a theme for a magazine publisher who routinely deals with a large number of images. I need them to be able to associate each image with a contributor (photographer, illustrator, artist, ...
0
votes
2answers
115 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 ...
0
votes
1answer
104 views

How to save media-form on custom tab

On my custom tab, I copied media-form from media_upload_gallery_form, only changed form id and action-url to reflect my tab's name. The form displayed as expected, but after click "Save All Changes", ...
0
votes
1answer
1k views

orderby not working for query_posts using array of IDs

I have an array of IDs that i send to query_posts to get the posts (which works fine) but it seems to always put the attachment(562) last even though it is the newest. Also tried title and ASC vs DESC ...
0
votes
1answer
720 views

SQL: Search query to get attachments only of those parents which are published

i'm having some problem creating nice 1 query to be able to get search results which includes NOT only post_type POST but also attachments. BUT if search query return attachment, i want that it won't ...
0
votes
1answer
81 views

Building custom pages with a video player

Hey i am trying to learn wordpress developement on my own, I'm building a celebrity gossip blog and i need help. I want to build a video page. Does anyone know of a plugin or anything that i can ...
0
votes
1answer
87 views

How can we select attachements based on Caption?

I am trying to select some attachements based on an attachement caption. I need to do this for a seperate download page. On the download page i want to display all attachment which caption equals "...
0
votes
1answer
131 views

Stop Attachment image names from taking top level permalink

I don't know why but images uploaded to my site in posts are getting a top level permalink. So if I upload an image into a post called "Apple" then it gets an attachment page at mysite.com/apple and ...
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 ...
0
votes
1answer
405 views

get_image_tag filter not working

I'm trying to get the custom field data off an attachment and display it following the image tag in a page/post using the get_image_tag filter. I'm using the same function to get the same data and ...
0
votes
1answer
191 views

Gallery Thumbnail Layout Template

Is there a way to create a template to display a gallery thumb layout? Or am I stuck with selecting a thumbnail size and rows in the upload image/gallery area and media settings area?
0
votes
2answers
3k views

Conditional Statement - check if post has an attachment image

I'm working on a conditional statement (in a loop) that looks for a featured image then grabs a default image if there is none, which I have figured out. But, I also wanted a way to pull the first ...
0
votes
2answers
4k views

How to access & display images from a post without textual content ( and vice versa) according to best wordpress practices

Looking to create a customized single.php for my posts. In one column I'd like to display all images added through the add media function (inserted into post). In the next column all other content ...
0
votes
1answer
1k views

How to force unlink on attached/inserted images?

When users insert an image into the content, WordPress automatically wraps the image in a hyperlink that, when clicked, creates an "attachment" page showing only the image inside the theme. Can I ...
0
votes
3answers
4k views

Create post from form with image

I found this wonderdul script that @Bainternet here at Wordpress Answers created, that makes it possible to attach images into posts from a html form.. I tried to combine in into my "html form to ...
0
votes
0answers
114 views

How do I protect my uploads?

If I type in url for some of my attachments: /wp-content/uploads/20xx/ I can easily download everything even if I'm not logged in which is not what I want to happen. How can I redirect users to login ...
0
votes
1answer
893 views

Media library only show 2 items per page?

For some reason WordPress media manager is only showing 2 images per page? This is happening on 2 separate sites now and I can't get rid of it. Is there a way to manipulate items per page for the wp-...
0
votes
1answer
38 views

Get Video Attachment to post

There is a plugin that let’s me upload a title, description and image with a form. If you send it, it creates and automatic post with the title, description and the image. The code for showing the ...
0
votes
1answer
8k views

Correct Syntax for uploading files to custom directory in Wordpress

I have current PHP code that works when attaching files on a form. The files have to go to a certain directory. I know that while attaching in Wordpress I need to use a different syntax. However, I've ...
0
votes
1answer
71 views

open image after clicking on single.php with different stylesheet in wordpress

i have single.php like if(have_posts()) {while(have_posts()){ the_post(); //content displayed }} in the content i have some images. As i click on the image it opens in very simple manner without ...
0
votes
2answers
1k views

WPML : how to pick a featured image only once for different languages?

I've got 3 languages on my site. Picking the same featured image 3 times for the 3 versions of each article is boring. Is there any way to do it only once ? (same for picking a tag)
0
votes
1answer
2k views

Change attachment inside the_content using filters

I am in search of a snippet or function that will filter the embedded images inside a post to a custom size I have defined in functions.php. Here is the scenario: A client uploads and add any ...
0
votes
3answers
389 views

Calling a javascript function in post edit page after attaching something to post

I would like to call a javascript function after user attaches something to post. I hooked the add_attachment hook, and processed what I want. However, how can I call a function in a Javascript loaded ...
0
votes
1answer
2k views

How do I get link URL (not file URL or attachment URL) of an attached image [duplicate]

Possible Duplicate: Retrieving a custom link on an attachment I am using images on a Wordpress page to link to other pages in the site. I know how to get an attached image's file or attachment ...
-1
votes
1answer
148 views

How can I attach files without using a plugin?

I want to add files from my site or from external links with files to any of my posts, and be able to add the size of the file and choose which ones it will do "File Force" and which not. I want to ...
-1
votes
1answer
728 views

how to edit attachments?

when attaching eg. files to a post, how can i edit/delete them afterwards? couldn't find anything in the post editor. thanks
-1
votes
2answers
248 views

Change the next thumbnail to text

Hey i am using this theme called starblog and on the single gallery page it shows this cpde below <div id="nav-images" class="navigation clearfix"> <div class="nav-next"><?...
-1
votes
1answer
1k views

Attachment page custom title?

Look what I want to do... I want to edit < title > < /title > from < head > < /head > on attachment page. Right now I have like this: POST PARENT TITLE (no - or | here ) IMAGE TITLE - MY ...
-1
votes
2answers
105 views

I want to edit documents on my blog without the need to download and upload files again [closed]

Would that be possible? Basically, I need something which will enable me to edit files directly at the server... any help would be much appreciated....
-1
votes
1answer
72 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
votes
1answer
178 views

Custom Fields, Media uploader, Attachments

I have added Custom Fields to the Media Uploader in WP3.5. I am unsure of how to have that data displayed on the Attachment page.
-1
votes
2answers
897 views

Open attachments in new tab/window

I'm trying to make every attachment link open in a new tab/window but checking the 'Open link in a new tab' checkbox in the post editor or adding target="_blank" manually doesn't seem to work. Links ...
-2
votes
1answer
73 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)?

1
15 16 17 18
19