Tag Info

New answers tagged

0

Although it shouldn't change based on your theme, this may be an issue caused by how this new theme handles images. As of WordPress 3.5, when you add a media object such as an image, there's a sidebar that appears on the right. Underneath the "Attachment Details" (preview, title, caption, etc.) there's a section called "Attachment Display Settings". In ...


0

I'm adding this in as an option I didn't see listed above... W3 Total Cache (link below). https://wordpress.org/plugins/w3-total-cache/ I use this because it has a wide range of CDNs it supports, including a generic setting, and will also take care of offloading media files, theme files and other core files that don't necessarily need to be served from ...


0

Another option - wpengine.com have a pretty stellar repulation as a dedicated WordPress hosting company and they recently released what promises to be seamless integration with Amazon S3 for large storage needs. It might be the best of both worlds. I'm not affiliated in any way - but I am thinking of trying it myself.


-1

I think the better way to use this plugin - http://wordpress.org/plugins/faster-image-insert/ We have a photo website and we use this plugin for a bulk uploading and bulk editing image attributes. You can run action that will change all your titles in way soccer1, soccer2. You also can change the order of your images and rewrite titles again.


1

Use post thumbnails. Add this to your theme’s functions.php: add_action( 'wp_loaded', function() { add_theme_support( 'post-thumbnails' ); }); And in your page template get the thumbnail with: the_post_thumbnail();


3

This sounds like a description of the JetPack's Photon service. Photon is an image acceleration and modification service for Jetpack-connected WordPress sites. Converted images are cached automatically and served from the WordPress.com CDN. Images can be cropped, resized, and filtered by using a simple API controlled by GET query arguments. When ...


0

I don't use MU and I can't test this right now but... If you started with a fresh 3.8.1, then your .htaccess file should look like this (per the Codex): RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ^wp-admin$ wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond ...


0

Your solution (edited incorrectly into the question) should be workable but you should be able to accomplish the same with fewer queries. Pull your portfolio IDs-- note the fields argument. Then pull your attachments with those IDs as the parent post. Then you only loop over the one image array. That works out to two primary queries. To wit: $query = ...


1

You have a variable scope problem. $post_id = wp_insert_post($post_information); function upload_user_file( $file = array() ) { require_once( ABSPATH . 'wp-admin/includes/admin.php' ); $file_return = wp_handle_upload( $file, array('test_form' => false ) ); // ... You set $post_id outside of your upload_user_file() function but that ...


0

I actually figured it out, I had the user assigned to the wrong role, so upload_files works. FYI the error was verbatum HTTP ERROR. If the error would have been permission denied I would have figured it out sooner.


0

Thanks @timocouckuyt, that works fine but you also need this one for the /wp-admin/upload.php link : add_filter('pre_get_posts', 'hide_posts_media_by_other'); function hide_posts_media_by_other($query) { global $pagenow; if( 'upload.php' != $pagenow || !$query->is_admin ){ return $query; } if( !current_user_can( 'manage_options' ) ) { global ...


0

You can wrap specific sizes in arbitrary html when they're inserted into post content via the image_send_to_editor filter. Here we check if $size is thumbnail and wrap it in a div, otherwise we just return the unaltered $html: function wpd_wrap_thumbnails( $html, $id, $caption, $title, $align, $url, $size, $alt ){ if( 'thumbnail' == $size ){ ...


0

I found how it could be done! Instead of using that function it was possible to add a query and another function. This is the code goes in the page.php file. <?php $subs = new WP_Query( array( 'post_parent' => $post->ID, 'post_type' => 'page', 'meta_key' => '_thumbnail_id' )); if( $subs->have_posts() ) : while( ...


0

You can hook onto add_attachment and force the slug to work off the filename like so: Update: To uppercase the slug, you'll need to add a temporary filter onto wp_unique_post_slug. You can't simply use strtoupper( $slug ) as WordPress sanitises (lowercases) it within the update function. /** * Force attachment slug to ignore title from metadata (if any). ...


1

It is not a direct answer for your problem. But I will help you to make image according to your need. When you use add_image_size it does not resize the existing images. it only works for the new images that will be uploaded after adding your add_image_size function. So your code will not generate new images for is_page_template function. But you can use ...


3

I have a plugin that does this manually in batch processes via ajax and I've been getting a lot of request for a way to make it automated. This is the function that loads the post, downloads the images into the uploads directory and attaches them to the post. Then it does a search and replace for the old img urls and replaces them with the new ones. Attach ...


2

If you want to create thumbs on the fly you can use Aqua image resizer, But there is a drawback of this mini script. The created thumbs will not delete upon deleting image from library. But its not a big deal. If required you can do so via SHH commands


4

Disclaimer: - This isn't actually an answer. - It is intended to help you with your additional research on the topic. - Furthermore it is reflecting a - at least felt - lately more frequent occurrence of similar questions regarding similar problems. Additional information regarding this topic on Wordpress Development: Removing Image Sizes for ...


7

This has always been a bugbear for me - the lack of on-demand image sizing, and the subsequent number of files you can end up with if you have lots of sizes! I can see the logic behind your efforts - the trouble is, add_image_size only truly comes into play at point-of-upload. As such, is_page_template(..) will always be false. A quick google dug up Aqua ...


0

Check/fix the URLs for the images; they are relative URLs, not absolute. Use Firebug with Firefox, or use the developer tools in Chrome or Safari or IE to see what javascript is loading on your site and the errors.


1

WordPress stores image (attachment) data as follows: Description: post_content field Caption: post_excerpt field Alt: _wp_attachment_image_alt meta value And in code, that translates to: // Description echo $post->post_content; // Raw the_content(); // Caption (description as fallback) the_excerpt(); // Caption (explicitly) echo ...


0

Use the string function instead, and print it only if you get something: $previous = adjacent_image_link(true, 'thumbnail' ); if ( ! empty ( $previous ) ) print 'before' . $previous . 'after';


0

I think this a better version of aalaap's answer: // In your template ... $avatar_url = get_avatar_url ( get_the_author_meta('ID'), $size = '50' ); // Get src URL from avatar <img> tag (add to functions.php) function get_avatar_url($author_id, $size){ $get_avatar = get_avatar( $author_id, $size ); preg_match("/src='(.*?)'/i", $get_avatar, ...


0

It looks like "Easy Apache" handles both Apache and PHP. Only a guess, but you have recompiled Apache/PHP without the needed image libraries-- either GD or ImageMagick. Without those, the server cannot physically resize images. You can use a phpinfo() script to see if the libraries are present. If not, you will need to recompile-- or whatever that "Easy ...


1

You really just need to check the source. get_background_image() uses get_theme_mod(), which applies the theme_mod_{$name} filter. So... function alter_background($name) { // return something apporpriate for the theme mod } add_filter('theme_mod_background','alter_background'); Note: the "name" component may be different. Use ...


0

This code might be what you're after. This loops through page templates to grab the featured image. If you add it outside the loop in your page.php template (or index.php, depending on your theme), it should grab the pages' featured image, not the posts'. <?php global $post; if ( isset($post) ) { //get the ancestors $familyTree = ...


2

Contrary to Pieter, I'd say your if statement is correct (although, unnecessary). If it's a WordPress theme, then add_theme_support will likely exist! Have you per chance added the images before setting the post thumbnail size? If so, you need to regenerate your images: http://wordpress.org/plugins/regenerate-thumbnails/



Top 50 recent answers are included