The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
47 views

How to make Next and Previous attached image navigation on the attachment page? [duplicate]

How to make Next and Previous attached image navigation on the attachment page? ' . __( 'Previous Image', '$text_domain' ) . '' ); ?> ' . __( 'Next ...
0
votes
1answer
12 views

Why can't I display attachment_image_src with Custom Size?

I'm trying to display an attachment with a custom size that I created with add_image_size called "custom-size-01" What the code returns is the word "Array" I've looked at the wordpress reference and ...
0
votes
1answer
468 views

Load post attached images on a single page site with fancybox

I'm trying to make a single page site that will display posts as thumbnails in some part. Then if a thumbnail is clicked, I want all the images contained in this post to be loaded with fancybox while ...
1
vote
2answers
397 views

Issue where WP Featured Image will not display

The code I'm using, is outside of WordPress i.e. define('WP_USE_THEMES', false); require('blog/wp-blog-header.php'); global $wpdb; The code that I'm trying to display the post thumbnail (the ...
0
votes
2answers
32 views

wp_get_attachment_image_src returns image on main domain, false on subdomain

I've got a multisite install in development where both the subdomains and the main site use the exact same page templates for showing data. However, when I try to get a profile image (added ID in ...
0
votes
1answer
557 views

Get single image from custom fields made with WCK custom fields creator

I used WCK Custom Fields Creator to create a repeatable custom field for uploading pairs of images (one color, one black and white) to posts. So for example, one post may have three fields, with two ...
0
votes
2answers
35 views

How to check if there is image title, caption, description?

I use this code to display featured image title, caption (excerpt), description (content): echo get_post(get_post_thumbnail_id())->post_title; echo ...
0
votes
2answers
270 views

Display Gallery Images from Custom Post Type

I want to display all the images added as gallery in a post with prettyphoto class. I am using this code. <?php /* The loop */ while ( have_posts() ) : the_post(); ...
-3
votes
0answers
20 views

How to get file name of featured image? [duplicate]

How to show file name of featured image in post on single.php? For example: Name of featured image is: "current-post-featured-image-file-name.jpg"
0
votes
1answer
75 views

Get the size (size in Kb or MB) of an featured image?

I need to display some featured image info on post page. Among other info I need to display file size of image (featured image of post). I tried this function inside single.php. <?php function ...
0
votes
1answer
51 views

Display featured image file size, extension, filename, type, orientation?

How to display some information of featured image in post. I need to display: 1. a. Image file size (in kb or MB) b. Image type (.jpg,.gif...), c. Bare image name, with and/or without image ...
1
vote
1answer
252 views

Function to auto-set a featured image that is already in use

I don't even know where to start with figuring this out.... This function for functions.php grabs the first attached image in a post and sets it as the featured image. The problem is that it will not ...
0
votes
1answer
703 views

get_children - wp_get_attachment_image

I explain my problem: I create a post with an image get_children - wp_get_attachment_image functions returns that image I delete post image and add a different one get_children - ...
0
votes
1answer
65 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 ...
2
votes
2answers
524 views

How might I retrieve a featured post image from an external WP site and display it as a link back?

I have two WP sites. I want to reach from one of them, into the other, and retrieve specific featured images for posts, and display them with a link to that post. I am using this line (with the ...
1
vote
3answers
684 views

change wordpress gallery shortcode to slider

Hi I wanted to change the default WordPress gallery short-code and make it a slider. remove_shortcode( 'gallery' ); function gallery_filter( $atts, $content = null ) { ...
0
votes
0answers
59 views

ACF Gallery insert from URL

Have built a gallery using Advanced Custom Fields (ACF) and Flexslider. The slider and images display correctly using the ACF code below. As most of the images will be hosted else where (on an other ...
0
votes
1answer
96 views

Get the URL, width and height of an image where the width and height are a specified minimum

Is it possible to get the URL, height and width of an image where the height and width are as a minimum the size I specify? wp_get_attachment_image_src() almost does this, but not quite, grabbing ...
0
votes
0answers
52 views

Some images not being returned with wp_get_attachment_image

For some reason this code works on my local copy of a wordpress site but the live site is not working. // WP_Query arguments $args = array ( 'post_type' => 'post', ...
1
vote
0answers
24 views

Get attachment id from WP Customizer

The WP Customizer's WP_Customize_Image_Control returns the attachment's URL, but I need the ID because I want to output the image like this: echo wp_get_attachment_image( $user_logo_id, ...
0
votes
1answer
79 views

Adding title and description to subpage's featured image

Hej! I have a subpage to display it's subpage featured image. I would like to add the title and description to beneath the thumbnail. Today my code look like this > In the functions.php function ...
0
votes
0answers
57 views

Add anchor tag on previous_image_link / next_image_link

I am using big headers on my website.I need the next/previous_image_link to target to the picture , not the top of the page. Is it possible to add anchor or to set the target on ...
0
votes
0answers
35 views

Incomplete attachment page

I am using the twenty-thirteen theme and my attachment page chops off the footer & image. Have a look at my screenshot. You can see that it shows the title but it doesn't show the image and the ...
0
votes
0answers
62 views

How to show post attachment image

i am going to create a slidershow by post attachment in single.php. i use this code but the result is null. <?php if ( have_posts() ) while ( have_posts() ): the_post(); ...
0
votes
2answers
714 views

How do I change/modify the_post_thumbnail(); html output?

I'm working on building out a custom theme and have been struggling with this one for a bit. I am trying to modify the HTML output of the_post_thumbnail(); function. I need to do this because I am ...
0
votes
1answer
200 views

wp_get_attachment_image() not working when trying to add with and height attributes

I am using wp_get_attachment_image() to try and output an img tag with width and height attributes. Here is my code: $thumb_src = wp_get_attachment_image( $id, 'thumbnail', false, array('width'=> ...
0
votes
1answer
94 views

I am trying to get metabox image with custom size

I am trying to get meta box image with custom image size. i used this code to get image but image is not displaying. <?php $img_src = get_post_meta( $post->ID, 'project_options', true ); ...
0
votes
1answer
556 views

How to get the next and previous image title from attachment or gallery?

I'm trying to build a slider exactly like this in wordpress. I have managed to make the slider work except the next/prev button. I need to get the next image title and the previous image title for the ...
0
votes
1answer
152 views

wp_query for displaying attachments with a tag

So I am running the following query: <?php $args = new WP_Query(array( 'post_type' => 'attachment', 'posts_per_page' => -1, 'oderby' => 'title', ...
0
votes
1answer
48 views

Exact image sizes

I am trying to define an image size of exactly 290 height x 180 width for all images uploaded to my WP site. I tried updating image sizes under Settings->Media->Image Sizes but these are only max ...
0
votes
1answer
73 views

Why am I getting and error from wp_get_attachment_image_src?

This Code: <div id="canvas" class="plan-page" style="background-image: url('<?php echo wp_get_attachment_image_src( stripslashes($options['sitePlan']), 'full')[0]; ...
0
votes
2answers
74 views

Create a link to full-sized image attachment?

I'm using some transitional css to "slide" up a div (".mask") which contains a short excerpt of the post when you hover over the post thumbnail. This works very well, but I'd also like to add a text ...
3
votes
2answers
106 views

Register an additional image size for only some images in my media library

There is a type of post on my blog which requires one extremely large image (such that it can be zoomed). I don't want to register a new image size, because I only need a certain small subset of ...
0
votes
1answer
79 views

Get a Page's attachments in Gallery order

Having created a page and a gallery within that page, I would like to retrieve all the images in that gallery in the order they are set when the gallery is created, i.e. the order which I drag them in ...
0
votes
2answers
134 views

Display number of latest images from wordpress gallery in your homepage

I was trying to get a solution for something that I am trying to accomplish. I am using the wordpress native and simple gallery to show images in a page called: "gallery" so far - very simple. it ...
1
vote
1answer
549 views

How to paginate attachments in a secondary query as gallery?

I have this code that shows all images attached to my post-type. Is there a way to paginate those? I have like 25 pics and I wan't to avoid scroll as much as I can. Code: <div class="galleries ...
0
votes
1answer
28 views

How do I get only a certain number of images from a post (minus the featured image)?

I have the following code (see below) that lists all attached images from a post. I'm trying to alter this code to only list the first five images, and also to exclude the featured image from the ...
0
votes
1answer
100 views

How to retrieve “custom url” from image attachment in wordpress

I have uploaded a bunch of images to a post and set the 'custom url' for each of them in the media uploader. How can I retrieve the custom URL assigned to each image into $caption_text= at the ...
0
votes
1answer
136 views

Unable to get wp_get_attachment_url to show

I'm trying to show a link to the full size image of an attached image. I took a code for Wordpress' Twelve Thirteen theme: <?php $metadata = wp_get_attachment_metadata(); printf( '<span ...
0
votes
1answer
53 views

Retrieving Image Storage path

$attachment_id = 8; // attachment ID $image_attributes = wp_get_attachment_image_src( $attachment_id ); // returns an array Could you please specify which database table is referred for to retrieve ...
0
votes
2answers
603 views

Remove height attribute from wp_get_attachment

I found this great solution: Stop wordpress from hardcoding img width and height attributes But I was wondering if I could do it only in one specific case and not in all the site because it messes up ...
0
votes
1answer
100 views

Retreive tags from attached post for media on page

I am working on a custom template file that pulls all images in my Media Library with a specific tag. I was able to get this working with some help from the community, it also shows the title of the ...
1
vote
2answers
2k views

Add Download Button in prettyPhoto Plugin

I would like to add a download button link for the full-sized image on the prettyPhoto lightbox when a user views a photo on my site. Currently I use the prettyPhoto Media plugin on my site, and I ...
0
votes
1answer
358 views

Get title of post image is attached to

So I found this post: Find the post an attachment is attached to and implemented Chip's suggestion but having a weird outcome. I am trying to pull the title of the post that the specific image is ...
0
votes
1answer
409 views

Get attachment by slug

I would like to get an image by specifying a certain slug and then echoing that address in the image src code. The slug for the image would be "book-site-header" I've looked through the ...
0
votes
1answer
46 views

Create a Link to Larger Image from within list of smaller images

I have this in my functions.php: function display_images_in_list($size = thumbnail) { if($images = get_posts(array( 'post_parent' => get_the_ID(), 'post_type' => ...
0
votes
1answer
94 views

Get Attachment Image Class by attachment id

I want Get wordpress media library image class. I have attachment id and I tired this but won't able to get it. print_r(wp_get_attachment_image_src( $attachment_id, $size, $icon, $attr )); How can ...
0
votes
1answer
249 views

Featured Image If Else Condition

I have my banner background set to the URL of the featured image. <div id='xpro_shell_text' > <?php if (has_post_thumbnail( $post->ID ) ): ?> <?php $image = ...
0
votes
1answer
100 views

list of attachments: wp_get_attachment_link works, wp_get_attachment_image does not

On single.php theme template file, I'm displaying the post's list of attachments. global $post; $args = array( 'post_type' => 'attachment', 'numberposts' => null, 'post_status' ...
1
vote
1answer
312 views

Exclude featured image from attachment loop

For my jigoshop theme I'm able to retrieve the images attached to my product post. However it pulls all images from both the featured image and my metabox images. What I'm trying to do is make it so ...