Articles of images

Convert attachment ID into url?

I’m using the plugin advanced custom fields to create custom fields to create a relationship between two pages. The code below is looking at the relationship field and grabbing the page title and company logo of the linked page. The only problem is that instead of outputting the image url (so it displays the image), […]

Trying to show link “Use as featured image” from Attachment window from t31os script

i found this great script from t31os that give me the chance to hide fields and buttons when we have to add images on a post in wordpress. function myAttachmentFields($form_fields, $post) { // Can now see $post becaue the filter accepts two args, as defined in the add_fitler if ( substr( $post->post_mime_type, 0, 5 ) […]

Issues renaming images during upload

The main reason for adding this snippet is all about SEO. The people I sometimes make websites for often aren’t that savvy with WP and tend to upload their stuff just as is. As these are often media related websites I try to help them a bit by automatically renaming their uploads from DSC_0010.JPG to […]

Allow users to contribute images to a post

I’d like to curate, per-post, a collection of images submitted by many different users. Meaning – when a user views a post, they’ll see as part of it the images that others have contributed, and will have the opportunity to contribute their own. What direction should I look in for implementing this? Thank you for […]

Clicks registering on Preview DNS site

I set up my site on a PreviewDNS, I have since pointed my Domain to the correct place and changed all the links to non-previewDNS links. However I can see (using Jetpack) that visitors to my site are somehow able to click on some images (I have the no right click plugin as well as […]

How wordpress handle upload images and how to use them in the code

When I upload images via the standard media uploader I notice that it upload the original images with the same name but creates other cropped copies of the original one and rename them with originalname-150×150 or -340-120 and so on. I double checked the Media tab in the admin panel, but there are only dimensions […]

How to change background image from WordPress Gallery

I am building a custom theme for a client in WordPress: She wants the background to change when you click on a gallery thumbnail in a post. It must be a solution, that doesn’t involve any coding on her end. create new gallery in a post » user clicks thumbnail » swaps background image » […]

A little confused as to what add image size actually does

I have a call to add_image_size like so: if ( function_exists( ‘add_theme_support’ ) ) { add_theme_support( ‘post-thumbnails’ ); } if ( function_exists( ‘add_image_size’ ) ) { add_image_size( ‘sidebar_thumb’, 109, 60 ); } But then when I try to use that image size in my template… if ( has_post_thumbnail() ) { the_post_thumbnail( ‘sidebar_thumb’ ); } The […]

Post Gallery list attachments except the one used as post thumbnail

I’m doing gallery in a single post after the post thumbnail. So I list all the post attachment with the image type (with the following query) but I want to exclude the post thumbnail. global $post; $args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘numberposts’ => -1, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘post_parent’ […]

If custom image header does not exist display text header

I’ve added a theme options page to my site (in my functions.php file): add_custom_image_header(”, ‘admin_header_style’); My header.php contains this code, which displays the Featured Image as the banner. If a Featured Image isn’t provided it uses the uploaded image banner from the custom image header. <?php //Custom header // Check if this is a post […]