All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

Can I programmatically edit a photo on the server side for a WordPress photo editor plugin?

I'm trying to use an existing WordPress WYSIWYG photo editor plugin like https://wordpress.org/plugins/digiwidgets-image-editor/ to manipulate a photo. Instead of using my browser to manually change ...
0
votes
1answer
28 views

Featured images duplicating and replacing next image

Took over a project, and one of the errors is the featured images (and certain others rendered in a similar way) are duplicating themselves and replacing the next image thumbnail. <a href="&...
0
votes
0answers
14 views

Automatically associate the product image with the SKU

I manage a website that references more than 40,000 products. We used WP ALL IMPORT to import the products (more than 48h of import), and we had problems with images that are not imported while they ...
0
votes
1answer
24 views

Only show first image in foreach loop

My loop shows a list of values, and underneath them, the post title and image for the value. The problem is that because some values are associated with multiple posts, multiple images show up. I ...
0
votes
1answer
16 views

Get list of posts from attachment

My gallery has dozens of images. Next to each image, there should be links to the posts attached to that image. (You can see these in Media Library, under "Uploaded To"). I am able to retrieve the ...
0
votes
0answers
15 views

I changed the template for WooCommerce product for category image (Category and Taxonomy Image plugin) but the image is still not displayed. Help!

I am trying to display category image instead of text on my product archive, but looks like something does not work. I am using Category and Taxonomy Image plugin (https://sl.wordpress.org/plugins/wp-...
0
votes
1answer
12 views

I can't load my images from a js file using wp_localize_script

I am using a slider to show my images that works fine on my sit but when I converted my site in to a wordpress theme it started giving me troubles on loading the images, slider is active but images ...
0
votes
0answers
15 views

How can I add links to posts and pages using a particular image from its own media attachment page?

I have various media attachment pages e.g. https://www.artobatours.com/rock-art-abric-del-mas-den-ramon-den-besso-muntanyes-de-prades-catalonia/ where I have the image and some exif data. Along with ...
0
votes
1answer
23 views

Change default gallery images - Currently they are displaying full size imagese

Right now my page load file size is 350mb... for a website... The reason is that the gallery is loading in the full size 4000px+ images when they are actually a mere 250px in the page: Is it ...
0
votes
1answer
16 views

How to create an unordered list of images separate from the content

Some of the solutions I'd tried are 'multiple featured images,' and 'upload image gallery,' but they're either require plugins, are too convoluted, or make for terrible html syntax. I've looked ...
1
vote
1answer
48 views

How to get next image with this code from same post?

I want to show images in my single-content.php file. I have almost 20 to 25 images in every post. I want to print them with below code one by one. I have to change one line in code for every image for ...
1
vote
1answer
45 views

IMG src weird behaviour inside a single post loop

I was trying to sort out the final look the featured image of a single post, so for the purpose wanted to add a class to the img tag. However on the way, I run into some weird behaviour while trying ...
1
vote
1answer
22 views

Unread Repeater field IMG alt not working

I've got a repeater field with images; <?php $produkt = get_field('produkte-startseite'); <div class="row start-products"> <?php foreach ($produkt as $produkte): ?> <a href="&...
1
vote
1answer
60 views

Adding Featured Image to Post programatically

How do I add a Featured Image programatically, given the URL/filename of the image, and Post ID associated with it?
0
votes
0answers
15 views

metabox images outside post (wordpress)

i have a little problem while getting images from a post to an external page, ex: i want to use lastest post images inside a slider used as header placed to the homepage (i'm using metabox to insert ...
1
vote
1answer
472 views

Convert all images to PNG on file upload

On my site I have a front end form for users to upload multiple images, using the following code --- if (!empty($_FILES['vidPix']['tmp_name'][0])) { $i = 1; $...
1
vote
0answers
144 views

Can't upload image using media_sideload_image

Have just concern about the media_sideload_image function, its does support https links image? and the wp_upload_dir() support https too? I've tried using media_sideload_image to upload image with ...
0
votes
1answer
27 views

I'm unable to call img path using single quotes in an array?

I would like to call an image next to input field in wp comment form. But I'm unable to do that. I call image when '' <= single quotes doesn't exist. But I don't know how to call an image in single ...
0
votes
1answer
35 views

Escape post image attachments added to template

What is the secure way to use wp_get_attachment_image() in a template?
1
vote
1answer
1k views

How do I get images (with a thumbnail preview) to show in search results?

The Short Version I've constructed a Wordpress site (Gazette theme base) with lots of image media. All have descriptions, captions, and titles but do not show up in search results; using Relevanssi I ...
0
votes
1answer
37 views

Wordpress automatically adds links to uploaded images

Wordpress automatically adds the link to every image I upload within Media. And then I can’t find a way to remove it. How can I upload images without links or just remove it? There is just no option ...
0
votes
1answer
505 views

Get the image title and alt from custom query

I think this will be a simple question for anyone who is familiar with WordPress and PHP. I'm not a PHP guru, so that's why I ask you guys! What we want is simple. Our images have a title and alt desc....
0
votes
1answer
43 views

How to include different html tags in the header for different pages?

I am changing the banner in the header based on the page id: if(is_page(14) or is_page(16)) { $class_name='bannerExp'; } if(is_page(18) or is_page(52) or is_page(22) or is_page(20)) { $...
-1
votes
1answer
35 views

Adding slides to an existing carousel manually

I inherited a website from another designer a while back and it was haphazardly put together then. I have been rebuilding it slowly but have never touched the carousel. Now my client wants to add more ...
-1
votes
1answer
50 views

Where to store the images of a custom WordPress theme?

I am creating a custom theme. If I add a picture to the footer for example and the picture is in the folder of the theme, the picture does not display. If I put it in the main wordpress folder it ...
0
votes
1answer
94 views

How to always display full size image

I'm trying to create a function that always inserts the full size image that was uploaded. My first thought was something like this: function image_tag($id, $alt, $title, $align, $size) { $size = ...
-1
votes
2answers
70 views

how to add “alt” for all image in wordpress

I am new to wordpress and StackExchange. I need to add alt attribute to all existing images for screen readers. But I have no idea which php file I need to work on. Also, how does wordpress make pics?...
1
vote
0answers
73 views

Upload multiple images to a Woocomerce product

I am trying to upload various images from an URL to a given woocomerce product. The issue I am facing with my code is that, although I see that the images are being uploaded to the server when I go to ...
0
votes
2answers
1k views

How to use thumbnail size of image if I'm only using src to get image

I have a custom field for an image, and using it this way: <?php $item_img = get_sub_field('image'); ?> <img src="<?php echo $item_img ?>" /> But I want to use the thumbnail ...
1
vote
1answer
224 views

How to upload imagick resource to media in wordpress

$filePath = wp_get_attachment_url( $id ); $tempfilename = explode("/", $filePath); $temppdffile = end($tempfilename); $cuurentPath = plugin_dir_path( __FILE__ ).$temppdffile; $im = new Imagick(); $im-&...
0
votes
1answer
78 views

what's the syntax for if the image exists get the image?

I want this to display images instead of posts. What would be the syntax for replacing posts with the images on my site? My code currently says while have post then show the post. I want it to be ...
0
votes
1answer
38 views

Get the id of all images in a post

Im trying to get the id of images from a post. i've tried with wp_get_attachment_url( $id ) and some other options but always get an empty array when i do var_dump or print_r. Whats the correct way to ...
0
votes
1answer
114 views

Shortcode function doesnt work without caption

I'm working on a site that has this function to output the caption of a picture and is credits/date but doesn't work if only credits/date are definied and caption isnt. If thats the case the function ...
1
vote
1answer
47 views

add_image_size for header_image

How can I add image size for header_image() just like featured image by using add_image_size() What is the correct way of adding image size for header_image()
1
vote
2answers
3k views

Auto crop images in Wordpress

Im brand new to coding in wordpress, usually I use ModX. In ModX there is a plugin called phpthumb which automatically crops images to a specified h and w. How can I achieve this in Wordpress? Image ...
2
votes
1answer
25 views

Assign a picture URL to a page via PHP

I would like to assign a picture URL via PHP to a page. I’ve googled already but just found something like this: https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ ...
2
votes
2answers
7k views

Admin Media grid view images won't load

All I did was adding this in my functions.php file: function save_nb_image() { global $wpdb; $id = $_POST['id']; $file = wp_get_attachment_url($id); if ( ...
1
vote
1answer
108 views

Accessing an image folder inside public web directory

I have put a folder in the public web directory of my WordPress installation where I have some images used by a legacy system. Say its located under http://example.com/legacy-images/image1.png. I ...
0
votes
1answer
18 views

How do I get the featured post to share on Social Media and show on Individual Post pages?

I could really use some help. I'm using the Hurricane Wordpress Theme. The one complaint I have is that the theme won't automatically include the featured image in the post's page, itself. The image ...
2
votes
2answers
933 views

Rename existing old uploaded images containing accented French characters (not during upload)

Need to update 1,000+ images which have French characters in them. The following worked for a test post: Created a copy of the image without the FR characters Updated file name inside the ...
0
votes
1answer
33 views

Images Uploaded saving onto older/previous year folders

Recently, I have noticed this scenario, where my images uploading to media library, saving on to older years, months not the current year. Is it possible to make image uploading to current, I am not ...
0
votes
1answer
81 views

Display an image based on field value

I am working in Wordpress trying to customize post layouts and am having trouble with a bit of php I've tried implementing. I am trying to display an image in the post based on the value in a ...
1
vote
2answers
815 views

How to get custom image size for image uploaded in Customizer

I'm using the customizer to upload an image. The code I have below displays the full size image ok but I would like to instead display a custom size of that image that I created below that. This is ...
1
vote
0answers
321 views

Why is image hard cropping for one image using add_image_size not working?

Why is hard cropping for the blog-grid-evensize not working? When uploading an original that is 667x596, the blog-grid-odd and blog-grid-featured sizes are correctly cropped from the left top edge. ...
0
votes
1answer
41 views

Else/If Statement to Display Photo Descriptions

I am building a news WordPress theme and using the Description for thumbnails to display who the photo is credited to on the website. I am then placing the credits in the Description on top of the ...
0
votes
1answer
772 views

Add custom url to featured image

Good afternoon everyone, I have little experience in php programming and I have a problem with the featured images. Use Advanced Custom Field’s and create a field where i put a URL. Need when click in ...
1
vote
1answer
664 views

Display post image with fancybox

I am trying to display the image with fancybox, but the code shows an empty href which is causing me problems with fancybox. What is wrong in this kind of code? it's showing up the correct image url, ...
1
vote
1answer
871 views

Get image's size name from it's dimension

As we know, image's sizes have different names which we can use to call the appropriate image size. Like 'thumbnail', 'large', 'medium' or a custom 'my-thumbnail' size. I can the_post_thumbnail_url( '...
0
votes
2answers
69 views

Which function crops images in wordpress?

I want to modify wordpress's core files to get a desired result for cropping and saving uploaded images. However, i can't find the function that handles the uploaded images and crops, renames and ...
3
votes
1answer
364 views

Wordpress remove EXIF Data from specific Thumb

Is it possible to hook in to action when uploading and resizing specific size added by add_image_size( 'mini-placeholder', 32 ) for image in Wordpress, and remove EXIF Data, and set quality of this ...