Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aq_Resize.process() error #105

Open
bladecold opened this issue Nov 16, 2017 · 2 comments
Open

Aq_Resize.process() error #105

bladecold opened this issue Nov 16, 2017 · 2 comments

Comments

@bladecold
Copy link

bladecold commented Nov 16, 2017

Hi,

error.log detail

fix error please.

Aq_Resize.process() error: $url parameter is required
Aq_Resize.process() error: $url parameter is required
Aq_Resize.process() error: $url parameter is required
Aq_Resize.process() error: $url parameter is required

example:

$thumb = get_post_thumbnail_id();
$img_url = wp_get_attachment_url($thumb,'full' ); 
$image = aq_resize( $img_url, 156, 104, true,true,true ); 
if ( has_post_thumbnail() ) { ?> 
   <img src="<?php echo $image ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" style="display: inline;" width="156" height="104" /> 
@awps
Copy link
Contributor

awps commented Dec 28, 2017

From this error results that $img_url is empty.
You should process an image only if a valid image url exists:

$thumb  = get_post_thumbnail_id();
$img_url = wp_get_attachment_url($thumb,'full' ); 
if ( ! empty( $img_url ) && has_post_thumbnail() ) : //Just to be safe
    $image = aq_resize( $img_url, 156, 104, true,true,true ); 
?> 
   <img src="<?php echo $image ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" style="display: inline;" width="156" height="104" /> 
<?php 
endif;

@tradesouthwest
Copy link

I had a theme using Aq_Resize and had to tell it the $url was empty in the theme's callback. Originally they had the final as:

if(!function_exists('aq_resize')) { /** * This is just a tiny wrapper function for the class above so that there is no * need to change any code in your own WP themes. Usage is still the same :) */ function aq_resize( $url, $width = null, $height = null, $crop = null, $single = true, $upscale = false, $size_force = false ) {

And I simply added a string value of '' nada and all the errors went bye bye.

if(!function_exists('aq_resize')) { /** * This is just a tiny wrapper function for the class above so that there is no * need to change any code in your own WP themes. Usage is still the same :) */ function aq_resize( $url = '', $width = null, $height = null, $crop = null, $single = true, $upscale = false, $size_force = false ) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants