Articles of images

How do i upload an image and return the image id?

I need to import images from an url and return the image id is it possible to make a function like this? <?php $link = ‘http://img.mywordpresstips.com/images/NI113D034-D11@12.jpg’; $title = ‘the image title’; $alt = ‘the image alt’; $image_id = insert_image($link, $title, $alt); ?>

Which tools should I use for a gallery that uses an API and url for the path of the images?

I am pretty new in WordPress and I am a little overwhelmed with the amount of elements and possibilities we have to build our site. So I would like some advices. The first think I want to do is a dynamic page with a Gallery of photos. In a nutshell: I have an API: it […]

Displaying “alt” attribute text as captions?

We are moving a large newspaper website from Drupal to WordPress and my last coding tweak involves displaying the legacy caption information from images in article posts. The caption information is included in “alt” and “title” attributes in the HTML for these images, so I basically need to display this info in the template for […]

Uploaded images not showing properly using wordpress

I need to insert post programatically in wordpress.. I finished to insert title and content.. But image is not uploaded and attached.. Can you suggest me.. $post_id = wp_insert_post( array( ‘post_author’ => $user->ID, ‘post_title’ => $Title, ‘post_content’ =>$Content, ‘post_status’ => ‘publish’, ‘post_type’ => ‘post’, ‘guid’ => $site_url . ‘/?p=’ . $post_id ) ); $Featured_image = […]

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 the featured image this take the URL of ACF and open in new tab. I found this code where […]

woocommerce show random image on category archive

I am trying to show a random image from products in category thumbnail. I don’t wanna fill each category image one by one, i wanna auto grub an random image from one product that belongs in this category. Is this possible?

Adding Carousel Image slider to Woo Canvas Theme on Posts Page

Fairly new wordpress user here with no PHP experience but CSS and HTML competency… I am trying to put a carousel image slider at the top of a posts page on a site that’s using the WooThemes Canvas Theme. At the moment, the slider is only available in the business and magazine templates. Ultimately, I […]

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 667×596, the blog-grid-odd and blog-grid-featured sizes are correctly cropped from the left top edge. But the blog-grid-even size is resized from the original 667×596 size, not cropped. I’ve tried this without using the add_action(after_setup_theme…, force regenerated thumbnails many times, deleted […]

Wrong Image URL

All images have a wrong URL path in the media library. I already checked the wp_options and the domain url is correct. How to fix this? http://example.com/files//var/www/html/wordpress2/files/2016/11/671-IP7A0879-300×187.jpg expected output http://example.com/files/2016/11/671-IP7A0879-300×187.jpg

Uncaught Reference error in Retina.js

I am trying to make my theme retina ready. i have included following code in my theme files. but it raise following Uncaught reference Error: Exports is not defined ………….js/retina.js?ver=4.6.1 line 12. I am wondering why it is saying that the error is in script file. as i have downloaded script file again and again […]