Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • I found a quick fix for this:
    First, you need to register a new image size with hard crop mode.
    Then, you modify the end of your image url so the cropped image is called (instead of the original image):

    if (function_exists('z_taxonomy_image_url') && z_taxonomy_image_url() !== false) {
    	$img_url = z_taxonomy_image_url();
    	if( strpos($img_url, '.jpg') ){
    		$insert_url = str_replace('.jpg', '-250x180.jpg', $img_url);
    	} elseif (strpos($img_url, '.png') ){
    		$insert_url = str_replace('.png', '-250x180.png', $img_url);
    	}
    	echo '<img src="'.$insert_url.'" class="alignleft"/>';
    }

    It is important to set your new image size to hard crop mode so the ‘250×180’ part of the url will work!

    Thread Starter clairele

    (@clairele)

    Thanks agelonwl!
    I had found those threads already though I hadn’t been able to figure out a fix for my problem.

    So I finally made a filter using the qtranslate qtrans_convertURL() function and this link:
    http://wp-events-plugin.com/tutorials/modifying-placeholder-default-information/

    This is what I came up with :

    add_filter('em_event_output_placeholder','my_em_placeholder_mod',1,3);
    function my_em_placeholder_mod($replace, $EM_event, $result){
        if ( $result == '#_EVENTURL' ) {
            if(qtrans_getLanguage() == 'en'){
                $replace = qtrans_convertURL(get_post_permalink($EM_event->post_id));
            }
        }
        return $replace;
    }

    Thread Starter clairele

    (@clairele)

    Hello,

    Thanks for trying but this is not what I meant.
    I am developping a theme and I need the frontend users to be able to control the number of items they want to see. This is a very usual feature on e-commerce websites for example.
    The solution should be a snippet or a plugin, I guess :/

Viewing 3 replies - 1 through 3 (of 3 total)