Sunday 23 June 2013

Wordpress Transfer Changes to Database

When transferring a Wordpress installation you need to change all the references to the old domain and replace it with the new.  Here's the MySQL 'find and replace' I used for mine.


update wp_options set option_value = replace(option_value,'wisemonkeymedia.co.uk','wmky.co.uk');


update wp_postmeta set meta_value = replace(meta_value,'wisemonkeymedia.co.uk','wmky.co.uk');

update wp_posts set post_content = replace(post_content,'wisemonkeymedia.co.uk','wmky.co.uk');

update wp_posts set guid = replace(guid,'wisemonkeymedia.co.uk','wmky.co.uk'

Friday 21 June 2013

Wadebridge to Padstow on the Camel Trail - Speeded up

Take a look at this video I've made


The intention is to show that the Camel Trail is suitable for All Mobility Access  - Where you can hire suitable bikes and trikes from this Wadebridge Bike Hire company

Joomla 2.5 Virtuemart transfer issue


UPDATE j25_virtuemart_category SET category_description = replace(category_description,"Â"," ");

UPDATE j25_virtuemart_category SET category_description = replace(category_description,"”","\"");

UPDATE j25_virtuemart_category SET category_description = replace(category_description,"–","-");

UPDATE j25_virtuemart_category SET category_description = replace(category_description,"…",";");



UPDATE j25_virtuemart_categories_en_gb SET category_description = replace(category_description,"Â"," ");

UPDATE j25_virtuemart_categories_en_gb SET category_description = replace(category_description,"”","\"");

UPDATE j25_virtuemart_categories_en_gb SET category_description = replace(category_description,"–","-");

UPDATE j25_virtuemart_categories_en_gb SET category_description = replace(category_description,"…",";");



UPDATE j25_virtuemart_products_en_gb SET product_s_desc = replace(product_s_desc,"Â"," ");

UPDATE j25_virtuemart_products_en_gb SET product_s_desc = replace(product_s_desc,"”","\"");

UPDATE j25_virtuemart_products_en_gb SET product_s_desc = replace(product_s_desc,"–","-");

UPDATE j25_virtuemart_products_en_gb SET product_s_desc = replace(product_s_desc,"…",";");

UPDATE j25_virtuemart_products_en_gb SET product_desc = replace(product_s_desc,"Â"," ");

UPDATE j25_virtuemart_products_en_gb SET product_desc = replace(product_s_desc,"”","\"");

UPDATE j25_virtuemart_products_en_gb SET product_desc = replace(product_s_desc,"–","-");

UPDATE j25_virtuemart_products_en_gb SET product_desc = replace(product_s_desc,"…",";");

UPDATE j25_virtuemart_currencies_en_gb SET currency_symbol = replace(currency_symbol,"Â"," ");



Thursday 20 June 2013

DF Marine Menu - Swap with a normal Menu.

The Menu on the theme DF_Marine is rather baffling .  As you can't control it from the normal access for a menu.

Looking at the code for it in /wp-content/themes/df_marine/header.php we get this code.

                $today = current_time('mysql', 1);
            if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 5")):
        ?>
            
                  post_title == '') $post->post_title = sprintf(__('Post #%s'), $post->ID);             echo "
  • "; the_title(); echo '
  • '; }?>            
           



Let's have a look how a Menu is normall called up


And in functions.php

register_nav_menus( array(
        'header-menu' => __( 'Header Menu', 'littleripples' ),
    ) );


Here's some information on it in the Wordpress Function Reference.

http://codex.wordpress.org/Function_Reference/wp_nav_menu

To fix the df_marine theme menu issue .  Here's what I did .  Please use a child theme as I did for this, however I'll explain the changes as if hacking the main theme.

OPEN df_marine/header.php

FIND
if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 5")):
        ?>
            
                  post_title == '') $post->post_title = sprintf(__('Post #%s'), $post->ID);             echo "
  • "; the_title(); echo '
  • '; }?>            
           


REPLACE WITH

     'menu-header', 'theme_location' => 'primary' ) ); ?>
                



SAVE


OPEN wp-content/themes/twentyten/functions.php 

register_nav_menus( array(
        'primary' => __( 'Primary Navigation', 'twentyten' ),
    ) );



SAVE

UPLOAD BOTH FILES

You'll now have a dropdown box in the admin area, where you can select a menu you set up .

goto
admin > appearance > menus 
see the 'Theme Locations' box on the left there.  See this image.  


change done for www.cameltrailcyclehire.co.uk

Resizing Images Perminant Change - inside your Wordpress Blog / Theme.

So you've got a theme where you'd like the images to display at a different size. You could change the image size on each individual post or you could make a change to your theme and from then on ( as long as the image you upload is bigger ) you will have that size image in your blog. There's two bits of code that are of interest
the_post_thumbnail( 'largeimage' );
This will be on your theme pages. In the case of what I'm making changes to its wp-content/themes/mytheme/category.php The function 'the_post_thumbnail' is from the Wordpress Framework and can is explained in the Function Reference here -> http://codex.wordpress.org/Function_Reference/the_post_thumbnail Here in my example the arguement 'largeimage' is being sent over to it. You will find this reffered to in the function.php of your theme ( or you can add the following line if needed )
add_image_size( 'largeimage', 420, 420 ); // Shop Page Thumbnails
This is referenced in http://codex.wordpress.org/Function_Reference/add_image_size PLEASE NOTE: this makes a new size when the image is uploaded. Meaning if you add this code after the blog is already up it will not work. http://www.padstowholidayaccommodation.co.uk

Monday 10 June 2013


Adding YouTube Videos to Tour Pages on Midway Responsive Wordpress Theme

Originally I wanted to add my embedded YouTube Video to the 'day' boxes on the left hand side of the Tour Pages on Midway Responsive Wordpress Theme.  As pictured here on the Polzeath Camping


Which looked fine on my PC.  However it messes up the Responsive aspect of this theme when you go small.  So making the site look awful on tablets and smart phones.

I added the Video just underneath the top gallery in the end.  I've tested this on a heap of views and it looks good. 

Here' what I needed to add to the code to make this work .  Please note I've made these notes as if you're hacking the 'Midway' theme but highly recommend you do this in a child theme concept. Also remember to make a full backup before attempting this.

OPEN wp-content/themes/midway/style.css

AT THE BOTTOM OF PAGE ADD

div.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0; overflow: hidden;
margin-top: 5%;
}

.video-container iframe, .video-container object, .video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}


SAVE AND UPLOAD

OPEN wp-content/themes/midway/single-tour.php

FIND

           
       



UNDERNEATH ADD

            $youtubevideo=themex_youtubevideo($post->ID);
        if ($youtubevideo != NULL) {
        ?>
        
         


SAVE AND UPLOAD

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

FIND

array(    'name' => __('Facebook','midway'),
                            'desc' => __('Does this tour have a seperate Facebook Account','midway'),
                            'id' => 'facebook',
                            'type' => 'text'),    


ABOVE ADD

array(    'name' => __('YouTubeVideo','midway'),
                            'desc' => __('The id of the YouTube Video you want to show for this tour .  If any!.','midway'),
                            'id' => 'youtubevideo',
                            'type' => 'text'),    


SAVE AND UPLOAD

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


################
All you need to do then to add further Videos is copy the Youtube id . Which is after the 'v=' in the URL.



FIND

function themex_emaillink($id=null, $before='', $after='') {


ABOVE ADD

function themex_youtubevideo($id=null, $before='', $after='') {
    
    $youtubevideo=get_post_meta($id,'_tour_youtubevideo',true);
    
    $out=$youtubevideo;
    
    return $out;
}  


SAVE AND UPLOAD

Thats all the changes to the site done.  Now you need to set the videos in the database.

You'll need to get the Youtube ID


> The goto your /wp-admin

> Go to 'Tours' on the left menu

> In the main window click on 'edit' - under the Tour you want to add the Video too.

> Scroll down to 'Tour Options' and paste the Youtube ID in . In the 'YouTubeVideo' input box. 



> then you'll need to click on 'update' - upper right hand side of the blog.



Wednesday 5 June 2013

Mobile Joomla on my home page on firefox goes to iphone version

After reading this post Mobile Joomla Forum I tried uninstalling and reinstalling but had the same problem.  However rather than further continueing to find a resolution for this I've decided to move away from using Mobile Joomla.

There's a couple things that have been bothering me about it.  Firstly I can't get my head around their code.  So hacking changes is difficult.  And after designing Responsive themes in Wordpress I've seen theres a better and easy way.  And I should have to pay $199 per year, per domain to be able to offer this to my clients.

JTouch -


However to do so on my Surfing Website means I would need to update Virtuemart 2  .  Which is too much outlay in time for the moment.  I will however get around to addressing this soon. 

Tuesday 4 June 2013

Adobe After Effects why are the layers greyed out


It's a bit like trying to learn how to drive but frustratingly you can't find where the ignition is but what I need to do is start creating layers.

This should be as easy as right clicking in 'Timeline' at the bottom.



However if this isn't working and when you click on > Layer > 

the dropdown here is all greyed out then you probably need to click on 'Create a New Composition' first.