Monday 18 March 2013

Wordpress Theme Milan - How to increase the descripiton box on image rollover on the frontpage.

I've just gone live with www.oceanblueclothing.com  and wanted to increase the description on the Image rollover on the frontpage.

>  if we look in the page milan/index.php on the line 128 we have the code

content(10);

If we then take a look at the content() function we have this function 

    function content($num) {
    $theContent = get_the_content();
    $output = preg_replace('/]+./','', $theContent);
    $output = preg_replace( '/
.*<\/blockquote>/', '', $output );
    $output = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $output );
    $limit = $num+1;
    $content = explode(' ', $output, $limit);
    array_pop($content);
    $content = implode(" ",$content)."";
    return $content;
    }

I've now created this function instead

    function lrip_content($num) {
    $theContent = get_the_content();
    $output = preg_replace('/]+./','', $theContent);
    $output = preg_replace( '/
.*<\/blockquote>/', '', $output );
    $output = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $output );
    $limit = $num+1;
       $content = substr($output, 0, $num);
    return $content;
    }

Then on index.php you can call it up with this code, using the number to limit to the size you want it to !

echo lrip_content(30);







No comments: