Skip to main content

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.

0 votes
1 answer
28 views

Get Specific Files (Only Specific Extension Type All Files in Loop ) from Media

I want to get Specific Extension Files from Media of Current Post Uploads—for Instance, .jpg or .png or .pdf, or MP4. (Get Only 1 Extension All Files From Current Post Uploads) Specific Extension ...
Islamic Quran Center's user avatar
0 votes
1 answer
35 views

Define how an attached image is rendered

When inserting an image block to a post, I want to control how the image is actually insterted in HTML. Specifically, I want to replace the autogenerated img element with a picture one, in order to ...
dgnin's user avatar
  • 143
1 vote
0 answers
28 views

How to insert information about the size and type of an attachment into page

I have a page and attachment addes to this page. Now I can output the content of this page with modified link attachment, when each attachment link otput title size and type of attachment like this &...
mardon's user avatar
  • 121
1 vote
1 answer
30 views

wp_get_attachment_links do not modify output for attachment links

I use filter for change link for attachments in a page function custom_attachment_link($markup, $id, $size, $permalink, $icon, $text) { // Get attachment meta data $attachment_meta = ...
mardon's user avatar
  • 121
0 votes
0 answers
21 views

modify the_content() for page to display attachments with own style

I have for display attachmet on page this function $attachments = get_posts( array( 'post_type' => 'attachment', 'posts_per_page' => -1, ...
mardon's user avatar
  • 121
0 votes
1 answer
39 views

Display file size and type on page or post with attachments

I have page and post in which user upload files as attachment and display link for donwload this files. How I can display after the size link type of uploaded file and the size? After answer in this ...
mardon's user avatar
  • 121
0 votes
0 answers
77 views

Using wp_mail to send attachment from a file stream content

I am using wp_mail to send mail with attachment. The attachment is not stored anywhere. The attachment contents are fetched viacurl request. This is what I wrote. This function below (...
sariDon's user avatar
  • 265
0 votes
1 answer
21 views

How to prevent wordpress from redirecting media attachment page to media page?

For some reason googlebot tried to index my media attachment pages and got redirected to media pages. This seems to be a default wordpress behavior. To recreate it, upload an image called test.jpg to ...
Nicolas Guérinet's user avatar
0 votes
0 answers
21 views

Can`t attach image to a multiple posts

It seems this question was asked multiple times in the past, but what is the current situation. Is the attachment of an image to a multiple posts possble? Right now when i attach image to more than ...
Konstantin Kurtev's user avatar
0 votes
1 answer
44 views

How to add year and month path to old attachment images?

I was using only uploads folder for attachment images. After a while, I started using also Year and Month folder. But I did realize something today. And that is, new uploads works perfectly but old ...
Aslan's user avatar
  • 13
0 votes
1 answer
31 views

Can I redirect media urls (not attachment pages) to the post parent?

I have a really unorthodox use case, perhaps. We have a set of pdf files which our colleagues would like to track downloads for. We have been using our web server logs to get code 200 requests for ...
ImADummy's user avatar
1 vote
1 answer
89 views

How can I get all attachments by a user on a WP multisite network?

I'm creating a front-end based project where users can make posts and add images to them. It's a network of sites that users have access to. For a better user experience, I want users to be able to ...
ToongeePrime's user avatar
0 votes
0 answers
50 views

Wordpress 6.3: WPallimport not taking images from Network Media Library

Setup: Wordpress 6.3 Multisite with Woocommerce Plugins: Network Media Library and WPAllimport Network Media Library is setup to take images from Site 1. WPAllimport is activated on all multisite sub-...
user2240778's user avatar
1 vote
1 answer
233 views

wp_get_attachment_image with custom size not rendering possible 2x srcset image

I'm noticing a difference (bug?) in how WP is rendering srcset images now. If I register my image sizes with add_image_size('single_featured_image', 1280, 9999, false); add_image_size('...
James0r's user avatar
  • 91
0 votes
0 answers
12 views

How can I move the position of the View attachment page link on the Attachment Details popup in the Media Library?

I'm not trying to be lazy but I can't seem to find a hook which describes how this might be done.
jchwebdev's user avatar
  • 775

15 30 50 per page
1
2 3 4 5
67