Monday 28 January 2013

Slider images not showing on Midway Responsive Travel Wordpress Theme

After installing this theme and setting up some Slides I couldn't see the images. 

This is to do with the site currently being on a temporary server ; ie the domain is web111.1920/~mysite.co.uk


Please take a look at this blog http://elementdesignllc.com/2012/01/how-to-fix-timthumb-using-a-virtual-directory-url-contains-tildes/
The following hack is so that you can get these images to work on your testing server.

Also fix below means the images will need to imported in at the correct size.

 As always before trying this hack make sure you've saved everything before hand.


OPEN


wp-content/themes/midway/module-slider.php

FIND

$out='<img alt="'.get_the_title().'" src="'.themex_thumbnail($post->ID,$width).'" />';

                  
REPLACE WITH

$out='<img alt="'.get_the_title().'" src="'.littleripples_thumbnail($post->ID,$width).'" />';



SAVE & UPLOAD


OPEN


wp-content/themes/midway/framework/functions.php



FIND

//Custom Dropdown Menu
function themex_dropdown_menu($menu_slug) {



ABOVE THIS ADD THE CODE


//Hack to get the slideshow working by littleripples.com
function littleripples_thumbnail($ID, $w = 0, $h = 0){
    global $blog_id;
    $src = wp_get_attachment_url( get_post_thumbnail_id($ID) );

    if (isset($blog_id) && $blog_id > 0) {
        $imageParts = explode('/files/', $src);
        if (isset($imageParts[1])) {
            $src = '/blogs.dir/' . $blog_id . '/files/' . $imageParts[1];
        }
    }

    $url = $src;
        return $url;
}







SAVE AND UPLOAD

No comments: