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);







Friday, 15 March 2013

Javascript works in IE8 & IE9 but not IE10

I'm currently using the theme Milan with Wordpress to create the webpage Ocean Blue Clothing  . 

The only problem I was having though is that it's working fine in IE8 & IE9 but not in the latest version. 

Here's the fix, I needed to add this code to the header

< meta http-equiv="X-UA-Compatible" content="IE=8" / >

The page now works fine.

Thursday, 14 March 2013

How to Make changes to Easy Tool Tip in WP admin


Easy Tool Tip

Here's some instruction for making tooltip and price changes for Bournemouth Car Valet






> go 'administrator' area

> click on 'pages' and 'all pages' on the left hand menu

> find the page 'PRICES' and click on 'edit'

> make sure the 'Visual' tab is Highlighted. 



> in this mode it's very straight forward to make prices changes


> for tooltip text changes - find the tip you want to change

[tooltip content="This will show in a tooltip" type="classic"]?[/tooltip]

and change the text "This will show in a tooltip"  to what you wish.

Tuesday, 12 March 2013

Wordpress Midway Theme - Capturing details in admin and retrieving on Tour Pages

I'm using the Wordpress Midway Responsive Theme and I need to change the booking and inquiries buttons so that they can go to various locations and email boxes.

So firstly I need to add a couple of boxes in admin; so we can save the information relevant to each tour.

OPEN

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

FIND

//Tours
            array(
                'id' => 'tour_metabox',
                'title' =>  __('Tour Options', 'midway'),
                'page' => 'tour',
                'context' => 'normal',
                'priority' => 'high',               
                'options' => array(

UNDERNEATH ADD

array(    'name' => __('BookLink','midway'),
                            'desc' => __('The Link where we want Booking to go to.','midway'),
                            'id' => 'bookinglink',
                            'type' => 'text'),   
                    array(    'name' => __('EmailLink','midway'),
                            'desc' => __('The Email address that enquiries should go to.','midway'),
                            'id' => 'emailaddress',
                            'type' => 'text'),   



SAVE and UPLOAD


after this change you'll then have extra input boxes in Admin.  And miraculously your infromation here get saved with no more changes need.  Out of interest those details are saved in the table  'wp_postmeta'  which uses these fields.
'meta_id, post_id, meta_key, meta_value'



To retrieve this infromation you'll need to make a function like

function themex_emaillink($id=null, $before='', $after='') {
   
    $emaillink=get_post_meta($id,'_tour_emailaddress',true);
   
    $out=$emaillink;
   
    return $out;
}


which you should save in a file like function.php

AND THEN TO PICK THE INFORMATION UP IN YOUR TEMPLATE

at the top of the page use

$emaillink=themex_emaillink($post->ID);


and then use  $emaillink in your page where you want to out put that information.






Tuesday, 5 March 2013

wordpress development how to show featured image in template

What I needed to search for to find the answer to this one was to look for development notes on Post Thumbnails.  Here's the codex page that tells you all about it . Wordpress Codex

All that needs to done is to open the template in a editor and add the code



where you wish the Featured image to display, check the codex link for other sizes.

Monday, 4 March 2013

Fistral Beach Webcams - Which one is currently best?

I'm doing a quick bit of research on Webcams and have noticed that eventhough there are quite a few pointing at Fistral now, many pages aren't currently worth Checking.  Here's a run down done on the 4th March 2013.


Anns Cottage Surf -  Probably the best free one; however if you haven't got Media Player updated then you can't see the high res version.  And the non high res cameras aren't that great.

Fistral Blue   - doesn't seem to be currently working.

Tiger 24 - Gets my vote for a free version.  You get a couple of angles

MSW -   you'll need to pay to be able to keep in on constantly.  Having adverts is very frustrating otherwise. Having said that this page is always worth a check anyway for the forecast.

Surf Check Live   - low quality and the camera needs cleaning.  It is free though and once the lens does get cleaned will be worth a check.


Headland Hotel -   - Seems to take and age to update and fairly poor quality.  On the plus side it's a pretty decent angle of the beach and its free.



Anyone know of any more ?

In the Wordpress Theme Midway Responsive I want to increase the tour columns on the tour page.

The key to doing this is on the page
wp-content/themes/midway/template-tours.php on line 115 we have the code.

if($counter==$row_limit) {
                        $counter=0;
                         echo '< div class="clear"></ div>';
                    }


If you ADD above

$row_limit = 5;  that will enable you to have a row of five ( with some CSS tweaking )  
The value for $row_limit is not set in the database but on line 11 of this page.

$row_limit=$layout!='left' && $layout!='right' ? 4 : 3;
$row_class=$row_limit==4 ? 'three' : 'four';

changing the code here means you'll have to make a few more CSS adjustments.  For me the Hack works fine, so I'll it as be.

Remember if your making these changes it makes sense to do so in a Child theme