Friday 27 September 2013

Hack the bullets for Revolution Slider - Wordpress Plugin.

It was requested by my client that they loved the square bullets but could they have some text for each slide in each button. What follows here is the notes of my hack. A full solution would be to make this read the slide title and have the option as a clickable choice in admin. As pictured here. The nice thing about this is that the bullets are highlighted with slide too. Having said that for the record here's my hack, which adds a class in the plugins JQuery file. And then once each bullet can be individually accessed by CSS . the rest of the hack is done in CSS. I had eight slides in this project but this could be expanded to as many or little as you need.


OPEN wp-content/plugins/rs-plugin/jquery.themepunch.revolution.min.js

SEARCH FOR
r.find(".bullet").each(function(r){var i=e(this);
if(r==n.slideamount-1)i.addClass("last");
UNDERNEATH ADD

if(r==1)i.addClass('second');
if(r==2)i.addClass('third');
if(r==3)i.addClass('fourth');
if(r==4)i.addClass('fifth');
if(r==5)i.addClass('sixth');
if(r==6)i.addClass('seventh');
if(r==7)i.addClass('eighth');


Then in your themes style.css add
.tp-bullets.simplebullets.square-old .bullet.first:after{
content: 'Graphics';

}

.tp-bullets.simplebullets.square-old .bullet.second:after{
content: 'Photography';
}

.tp-bullets.simplebullets.square-old .bullet.third:after{
content: 'Film';
}

.tp-bullets.simplebullets.square-old .bullet.fourth:after{
content: 'Audio';
}

.tp-bullets.simplebullets.square-old .bullet.fifth:after{
content: 'PR';
}

.tp-bullets.simplebullets.square-old .bullet.sixth:after{
content: 'Events';
}

.tp-bullets.simplebullets.square-old .bullet.seventh:after{
content: 'Advertising';
}

.tp-bullets.simplebullets.square-old .bullet.eighth:after{
content: 'Clients';
}

.tp-bullets.simplebullets.square-old .bullet.last:after{
content: 'Online';
}

Wednesday 11 September 2013

Safe Import of MySQL database

I've written a few blogs with this issue.  Here's a quick example of the code that I now wrap my imports in .  And I now have now charset or bad character issues.  I hope this helps you too.

Please note that the
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
will go infront of all the new tables that you're importing and
/*!40101 SET character_set_client = @saved_cs_client */;

goes after 


-- MySQL dump 10.13  Distrib 5.5.16, for Win32 (x86)
--
-- Host: localhost    Database: mine
-- ------------------------------------------------------
-- Server version 5.1.62-community

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `wp_postmeta` (
  `meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `post_id` bigint(20) unsigned NOT NULL DEFAULT '0',
  `meta_key` varchar(255) DEFAULT NULL,
  `meta_value` longtext,
  PRIMARY KEY (`meta_id`),
  KEY `post_id` (`post_id`),
  KEY `meta_key` (`meta_key`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7911 ;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `beforeUPDATEwp_postmeta`
--

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
INSERT INTO `wp_postmeta` (`meta_id`, `post_id`, `meta_key`, `meta_value`) VALUES
(1, 2, '_wp_page_template', 'template-home.php');
/*!40101 SET character_set_client = @saved_cs_client */;
-- ----

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

Tuesday 10 September 2013

wordpress button Not Found The requested URL * was not found on this server.

If you've recently moved, transferred or have a new Wordpress installation then you may find the following issue when you click on a menu item / button.

Not Found The requested URL * was not found on this server.

the solution for me . ( on a unix server ) was to add the following as the .htaccess file at root.


# BEGIN WordPress

RewriteEngine On
RewriteBase /wp/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]

# END WordPress

Monday 9 September 2013

How to Add Pinterest Boards with Pin it buttons to your Wordpress website

!!note: this has been updated with version 1.01 of Pinterest to Wordpress by DeanDev

The mission here was to help make a website that intergrates with the clients Pinterest boards. 
Ideally I'd of liked to have the pages look as much like Pinterest as possible but have had to make some concessions because of time and investment. 

Here's an image of what I've achieved.



The plugins I've used are ->

Pinterest to Wordpress Plugin

I would have liked the Pin it button to have appeared as a roll over on the images like on Pinterest - as in this plugin Pinterest Pin it Button for Images but as the gallery on Pinterest to Wordpress Plugin uses script rather than '' tags it doesn't work .

So I used Pinterest "Pin it" Button

and used the following hack to show on Pinterest to Wordpress Plugin 

OPEN
wp-content/plugins/pinterest-to-wordpress/shortcodes.php

on line 103 FIND

$desc='
'.str_replace('/search', 'http://pinterest.com/search', urldecode($ttls[$i]) ) .'
';
REPLACE WITH
$pinitButton = do_shortcode('[pinit]');
     
     $desc='
'.str_replace('/search', 'http://pinterest.com/search', urldecode($ttls[$i]) ) .'
'.$pinitButton.'
';
You should also add some CSS to your style.css . I've used
div.PinItButton{
float: right;
margin-right: 4%;
}

Thursday 5 September 2013

Wordpress how to change admin menu name

I was going to do this task manually; but using this plugin seemed like the easiest way

 Wordpress how to change admin menu name

Wednesday 4 September 2013

Joomla Slideshow CK - how to show youtube Video


You'll notice while setting this module up that in the Video demonstrated it's for Vimeo; and is like 'http://player.vimeo.com/video/32575033'  .  You may also have noticed that if you use the Youtube URL that your video doesn't display.

What you need to do is enter the Youtube URL in the following format. You can get this from the Youtube EMBED code if you need it.  Otherwise just swap the Youtube ID for yours

http://www.youtube.com/embed/XWXN08oW-Ss