get_post_gallery_images returns thumbs . I want full size
If you’re working within a template file, this code should work. However, I didn’t test it. <?php echo do_shortcode(”); ?>
If you’re working within a template file, this code should work. However, I didn’t test it. <?php echo do_shortcode(”); ?>
Register the shortcode, ideally in a plugin or functions.php if you have to. add_shortcode(‘thumbnail’, ‘thumbnail_in_content’); function thumbnail_in_content($atts) { global $post; return get_the_post_thumbnail($post->ID); } Add the shortcode to you post content. [thumbnail] If you want more features, see this post or the pastebin. ADDING CAPTIONS AND LINKS add_shortcode(‘thumbnail’, ‘thumbnail_with_caption_shortcode’); function thumbnail_with_caption_shortcode($atts) { global $post; // Image … Read more
Built in features The Media Library has major updates with the upcoming version. You can see the changes in the slides by Daryl Koopersmith here. You can read the announcement and discussion on “Make”. Your request for “tags/categories” is already built into 3.5. Note The difference between themes and plugins is pretty easy: Display vs. … Read more
Adapted from this thread on the WP forums: <?php if (has_post_thumbnail( $post->ID ) ): ?> <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), ‘single-post-thumbnail’); ?> <style> #banner-id { background-image: url(‘<?php echo $image[0]; ?>’); } </style> <?php endif; ?> Add this to your single page template, after the_post(). I’d reccommend having a default header image so that if the page … Read more
The problem isn’t so much the uploading itself, as that is a network connection between the client and the server. It’s not what’s eating the server’s memory. When WordPress starts ‘cruncing’ the images, that is where PHP comes in and start resizing and cropping the uploaded images. It is before this moment you need to … Read more
WordPress doesn’t store path of generated sizes anywhere, you need to build it. As suggested by @kraftner in comments, wp_get_attachment_metadata() can be used to obtain some of the pieces you need to build the path. An alternative is image_get_intermediate_size(). The missing piece is the absolute path of upload folder. In theory, that can be retrieved … Read more
It depends on your image and stylesheet location. But this is the syntax: .theme-image { background-image: url(‘../images/header-img.jpg’); } The above code is for the structure wp-content – themes – your-theme – images – header-img.jpg – css – style.css You are making the browser come one directory before and search for images directory.
Long story short, you can get info about an attachment by using wp.media.attachment() function. This will give you complete data as long as this attachment is already loaded by another script or an wp.media() popup. If the data is not yet loaded, you can load it using .fetch() method on attachment, which works because it … Read more
Say you have image foo.jpg and bar.jpg in your media library. foo.jpg has caption saying “foo”, and bar.jpg has caption saying “bar”. Create a gallery with those two images, they will show with “foo” and “bar” captions. Want to use them again with a different caption, but using a gallery? No problem. Make another gallery … Read more
Yes! Orangelab has built a plugin which can replace WP’s use of GD with Imagemagick (provided it’s already installed on your server – it’s not included) for creation of all image sizes and thumbs, and even regenerate existing images too! For anyone who cares about image fidelity, this is huge deal, as GD does not … Read more