Articles of images

A mystery 300px image size

I wonder if you can help me track down why all my images are being cropped to a 300px size that I’ve not specified anywhere at all. I know from some digging in the past that WordPress introduced a default size of 768px and basically hid it from us, now I’m wondering if they (or […]

get the image of the post

Im running ‘the loop‘ and I want to get the image of the post (in original size – not thumbnail), how do I do it? thank you.

HTML tags in WordPress image caption

I’m developing a client website with WordPress (3.3) but have found that the image caption feature strips out any HTML tags. The resulting caption is plain text which makes proper image crediting difficult. Also being a client website, WYSIWYG editing is required. For example if my shortcode is: The tags are stripped from the caption […]

WordPress Theory Lesson – Image Columns within posts with alignment?

Trying to get my head round a request from a client, and thought I’d try to hivemind the solution a little bit. The client requires a two column post layout, with images down the right and text on the left. Now, that bit it relatively straight forward (he says, having not tried it yet), but […]

Add url from Custom Field as 'Featured Image'. Code not working

I’m trying to migrate a site to WP. We have a whole bunch of pictures, and I have done some research and figured — I think — my best bet is a CSV import of the data, storing the relative URL of the image as a custom field. So, I found this –which looks ideal […]

How to display images in related posts?

I want to display an image for each related post. Note, these are inline images, not from post thumbnails. What I need is: If the post has an only image, show it. If it has multiple images, show the first one. If non-images, show a static alternative. Below is what I have currently. <?php $categories […]

including image assets in widget

I’ve written my first simple WP widget– it all works fine, but I’d like to dress it up a bit, and add an image / logo in the widget display code. How do I package the widget (which is just a single PHP file) with the image, and where will the image be stored in […]

Setup A Default Featured Image

I’m trying to setup a default fallback featured image on my website to ensure consistency with images being displayed for every post, even when an image is not embedded in the post. I’ve tried a number of plugins – Default Post Thumb and Default Thumb, however neither of these seemed to work. I’m using WP […]

Can I the caption shortcode to set caption to a data attribute, and with the image's alignment intact?

I want to output an image caption in this kind of format: <img class=”alignleft size-medium wp-image-316″ alt=”Image Title” data-caption=”Here lies the image caption” src=”×266.jpg” width=”400″ height=”266″> I got the basic caption code from WP Core and ran it through the add_filter( ‘img_caption_shortcode’, ‘my_magic_caption’); filter, which seems to work fine. My problem is that I can’t […]

Remove image classes from post thumbnail output

I wish to remove the image classes generated by default in the output whenever post_thumbnail() is called – <img width=”1024″ height=”768″ src=”×768.jpg” class=”attachment-large wp-post-image” alt=”Yet another example”> I’ve read a bit about the remove_action() filter and this seems the way to go but I’m not sure how to use it.