Tag Info

New answers tagged

0

Normally, if you want to crop a thumbnail you have to say so using "true" as third parameter. array(1024, 512, true) At least thats how you do it if you defined a thumbnail image size in your functions.php. So I guess it should work in the the_post_thumbnail array too :) Well, and if it doesnt't you could still define a thumbnail size in your ...


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 ...


2

it is much easier with WordPress inbuilt function media_handle_upload http://codex.wordpress.org/Function_Reference/media_handle_upload // These files need to be included as dependencies when on the front end. require_once( ABSPATH . 'wp-admin/includes/image.php' ); require_once( ABSPATH . 'wp-admin/includes/file.php' ); require_once( ABSPATH . ...


1

0 should work as a height in your thumbnail settings. The only other issue is that your uploaded images might be smaller than the large media size you're inputting. Image thumbs won't be scaled up for obvious reasons. If your images are larger than your thumbnail setting and you're still not seeing thumbnails generated then: Check your server logs Try ...


0

You should set your height to 9999 in order to keep aspect ratio


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.


0

It seems it was a theme error. As per Oblaksoft, it assumes that all images reside on the server's file system and doesn't work with images in the cloud. It's hard when a theme is not fully compatible with Wordpress hosted under Amazon EC2. =(


1

You should not use the_ID() in this case, since it will echo the ID, use instead get_the_ID() to return it. So please try this instead: $thumb_id = get_post_thumbnail_id( get_the_ID() ); to get the ID of a post thumbnail image. The general rule is that the_*() functions will echo the output, but get_*() functions will return it. But of course there ...


0

This is the best solution worked so far for me, which is combination of multiple solutions i found online, With this code you can display Sub Page Featured Image and Title with anchor link. Also this work for Sub and Child page too. <!--Child Page Thumbnails Start--> <?php $subs = new WP_Query( array( 'post_parent' => ...


1

You are misreading the Codex. wp_get_attachment_image_src() works just fine with custom image sizes. Proof of concept: // copied from the Codex // https://codex.wordpress.org/Function_Reference/add_image_size if ( function_exists( 'add_image_size' ) ) { add_image_size( 'category-thumb', 300, 9999 ); //300 pixels wide (and unlimited height) ...


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 ...


1

$port_query->the_post(); should set the $post global. That isn't the problem. The problem is that the you are trying to use $post before your secondary Loop runs (99% sure). You've hooked the bkg_featured_image() function to wp_head. wp_head runs in the header of the document, which, unless you are careful, will run before the other template code. If ...


0

WP_Query does use $post. A full list of Methods and Properties can be found In the codex here. Are you sure that all your Portfolio items have featured images? you might want to use 'meta_key' => '_thumbnail_id', in the arg to make sure the random Portfolio has an image. you could also check in the template using if( has_post_thumbnail( $post->ID ) ...


0

media_handle_sideload handles the uploads in the same way the normal upload does. That means, when you upload a remote image (YouTube thumbnails in your case) it will automatically create the thumbnails of sizes registered using add_image_size. So, what you need to do is create a thumbnail of desired size and call it in your loop. function my_setup() { ...


0

Take a look to this plugin it creates unlimited image sizes (cropped and not) it adds sizes on media select field it adds css filtering and animations it can manage watermarks


3

There are several hooks in get_the_post_thumbnail for example begin_fetch_post_thumbnail_html end_fetch_post_thumbnail_html /wp-includes/post-thumbnail-template.php You could add a function to one of these actions which removes your filter on first run. If you need further help with this please add some code how you filter the_content.



Top 50 recent answers are included