Tuesday, 26 March 2013

Making seperate Social Media buttons for each Tour in Wordpress Midway Responsive -

Working on Wordpress website with the theme 'Midway Responsive' I was asked the following question by the customer.

Change the Home page FB icon link to our main tours Social Media stream and if possible on each tour page we would like the social media links to be different?

Here's how I solved this problem; I'll show you how to do it for the facebook link, for the rest all you need to do is repeat the process but replacing 'facebook' for the media stream you want.

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

around line 360 find
//Tours			array(				'id' => 'tour_metabox',				'title' =>  __('Tour Options', 'midway'),				'page' => 'tour',				'context' => 'normal',				'priority' => 'high',								'options' => array(
ADD UNDERNEATH
array(	'name' => __('Facebook','midway'),							'desc' => __('Does this tour have a seperate Facebook Account','midway'),							'id' => 'facebook',							'type' => 'text'),	
SAVE

OPEN wp-content/themes/(your child theme name)/header.php

FIND
						

REPLACE WITH
					ID,'_tour_facebook',true)) { 					$facebooklink=get_post_meta($post->ID,'_tour_facebook',true);?>					

SAVE AND UPLOAD
It's also worth reading this about Taxonomy , which is the process that your using to add to the array http://codex.wordpress.org/Taxonomies

Monday, 25 March 2013

Some changes to Wordpress Midway responsive theme

Here's a few requested changes that I had to make to the Midway Responsive theme.  with how I solved these issues.  Please note I've made a Wordpress child theme called Zeathcamping ; which is why the folders are directed to that and not 'Midway'

Remove the Price and other Bullets points from the Tour Pages. >


OPEN

wp-content/zeathcamping/single-tour.php 
Around Line 44 to 48 commented out. 



Make the pricing tables stand out more especially where there is a special offer etc maybe use colours or bigger text

First off I needed to go into the 'tour' pages in admin and add the text 'class="info" '  to the tables I'm improving.

Then OPEN
wp-content/themes/zeathcamping/style.css

at the bottom add.

table.info{
font-size: 1.2em;
font-weight: bold;
}

Make the "Book Now" buttons bigger

OPEN wp-content/themes/zeathcamping/style.css
.button.small.tour-button span {
font-size: 1.4em !important;
font-weight: bold;
padding: 1% 20%;
}
 
On Home page change order of tour can we change the order of the polaroids / tours. 


This order is taken from when the tour is added. So the simplest way to change the order was to change the date of when this was added.
 

>Go to wp-admin/
>go to tours on the left hand side


> take a note of the dates and click on the tour you want to move.
> on the upper right hand side; under 'Publish' click on 'edit' next to the “Published on:” text.






Change "travel guide" title on homepage to "Blog"
  • in admin > go to Pages > Home page

    find the code [one_fourth][title]Travel Guide[/title][posts number="1"]

    you can edit the number of blogs here also




Photoshop Stroke is coming out blurry everytime

Photoshop Stroke is coming out blurry everytime What you need to do is check that your Feather is set to Opx. And then redraw the circle again.

Tim_thumb issue in Wordpress in Midway Responsive travel theme

http://elementdesignllc.com/2012/01/how-to-fix-timthumb-using-a-virtual-directory-url-contains-tildes/

Sunday, 24 March 2013

Joomla 1.5 Getting a list of CCB Forum users names and email

On a Joomla 1.5 setup where they are using the CCB forum I wanted to get a list of Names and email addresses of the forum users. here's the mysql I used for this.
SELECT ju.name,ju.email FROM `jos_ccb_users` AS jcu LEFT JOIN `jos_users` AS ju ON ju.id = jcu.user_id WHERE jcu.id > 1

Thursday, 21 March 2013

Wordpress Plugin that shows your latest Ow.ly image in a Widget

This a follow up to the blog How to make a Wordpress Widget Plugin . 

My aim here is to make Wordpress Plugin that shows your latest Ow.ly image in a Widget .   If you make a folder called 'owdotly-image' in the 'wp-content/plugins/' folder  and then save the following code as file 'owdotly.php'  this will work.  I'll add some CSS to it and then try and get it added to the official Wordpress directory.


 __('This widget will show your latest Ow.ly image',''),));
}
  
  
  function form($instance) {     
    $instance = wp_parse_args((array) $instance, array( 'title' => '', 'twit_username' => ''));
    $title = $instance['title'];
	$twit_username = $instance['twit_username'];
?>
  

', $array); list($newimage, $junk) = explode('"', $imageplus); $info = 'Polzeath nowClick here for the latest image.'; return $info; } function widget($args, $instance) { $Title = $instance['title']; $User = $instance['twit_username']; echo "

$Title

"; echo ''.$this->get_owdotly_page($User).''; } } add_action( 'widgets_init', create_function('', 'return register_widget("Owdotly_Image_Widget");') ); ?>

How to make a Worpress Widget Plugin - Stage 1

Here's what I want to do: Grab the latest picture from my Ow.ly account ( which is what I send to from my mobile Twitter account ) .
The way I'd like to do this in Wordpress is to create a plugin. To create a Wordpress Widget then we need to extend the WP_Widget API. Make sure you follow the example here http://codex.wordpress.org/Widgets_API .

Here's my notes on how I did it; that may help you and will hopefully help myself to simplify the process when I come back to it in future.

 1. Once the Class is set up the key areas to remember are (http://azuliadesigns.com/creating-widgets-wordpress-28/)

 form() - this is whats called up in (Appearance -> Widgets)

 update() - saves the data weve entered above

 widget() - output the widget from the details we have above and what we've created in this class


The following code is to show the first stage of writing my plugin. I think it shows a good example of how the 'Sample Plugin' in the above link is expanded.

Notice how an extra instance is added to the form and how that is dealt with in 'update. The 'widget function' is at its most basic to prove we can save information and retrieve it.
/**
 * Plugin Name: Ow.ly Image Displayer
 * Plugin URI: http://www.littleripples.com/owdotly-image-displayer
 * Description: A widget that shows your latest Ow Dot image 
 * Version: 0.1
 * Author: DJ Millward
 * Author URI: http://www.littleripples.com
 * License: GPLv2 or later
 * Text Domain: owdotly-image
 */
 
 class Owdotly_Image_Widget extends WP_Widget 
{
  public function __construct()
{
parent::__construct('Owdotly_Image_Widget','Ow.ly Image Displayer Widget',
array('description' => __('This widget will show your latest Ow.ly image',''),));
}
  
  
  function form($instance) {     
    $instance = wp_parse_args((array) $instance, array( 'title' => '', 'twit_username' => ''));
    $title = $instance['title'];
	$twit_username = $instance['twit_username'];
?>
  

$Title
"; echo "$User "; } } add_action( 'widgets_init', create_function('', 'return register_widget("Owdotly_Image_Widget");') );