kieranbarnes Independent PHP, WordPress & CubeCart Programmer

Getting YouTube thumbnails for HTML

Posted on November 4, 2011

It's so simple to embed a YouTube video, with thumbnail into your site. Ditch any clever PHP scripts or completed jQuery libraries.

So you have a Youtube video - http://www.youtube.com/watch?v=t4_dZPVg8KI

Take the video ID t4_dZPVg8KI and craft yourself a link to YouTube's image server;

http://img.youtube.com/vi/t4_dZPVg8KI/1.jpg

You have a choice of 1.jpg or 2.jpg or 3.jpg

How easy is that!

Tagged as: , No Comments

WordPress/Shopp Shipping Calculator/Options Access-Control-Allow-Origin Error

Posted on November 4, 2011

I've recently been debugging a customer's WordPress/Shopp store. When the customer set the Cart & Checkout to be served over SSL  the shipping calculator failed.

Serving Cart / Checkout / My Account pages over SSL is not built into Shopp for some reason. I have a post on this -  SSL/HTTPS for Shopp pages or checkout process only. If you use a shipping calculator, or offer different shipping methods this will fail.

[Snippet] Debugging Smarty on a live site

Posted on November 3, 2011

Development server? Staging server? What are they? Sometimes we have to debug code on a live server. You know it.

Adding the following code to your Smarty template will enabled the Smarty Debug Console for your eyes only.

  1. {if $smarty.server.REMOTE_ADDR == 'YOUR.IP.ADDRESS'}
  2. {debug}
  3. <pre>
  4. {$smarty.request|@print_r}
  5. </pre>
  6. {/if}

 

 

Money Website of the Week

Posted on October 20, 2011

The Sunday Mirror voted my customer's site - CompareMoreDeals to be their Money website of the week this Sunday. Propa bo.

T site which searches and compares thousands of offers from daily deal websites such as Groupon, Crowdit, Wahanda and Likebees.

It’s aims is to save time by doing the comparisons for you.

You can search by category, such as restaurants or fitness, or by location.

Cities covered include Aberdeen, Bristol, London, Cardiff, Manchester and Liverpool.

See the Mirror article here.

[Snippet] Allow PHP in Smarty (CubeCart 5)

Posted on September 28, 2011

Although it is generally bad practise to put PHP code directly into your (CubeCart 5) Smarty templates, its sometimes inenvitable.

You will need to edit controllers/controller.index.inc.php

How To List A Custom Post Type’s Taxonomies And Terms

Posted on September 21, 2011

Jennifer M. Dodd has published a brilliant article on listing post taxonomies / terms / formats & categories. I love it!
Entitled  How To List A Custom Post Type's Taxonomies And Terms, she offers two functions that cover displaying all custom taxonomies, terms, post formats, categories and tags.

Just saved me hours writing my own. Thanks!

Filed under: PHP, WordPress No Comments

New Site: Salford City Stadium

Posted on September 21, 2011

A fantastic show case site for the new Salford City Stadium for Salford City Council. Developed in WordPress I was involved in the Events Management and booking system. Set to be used by thousands of people when the stadium opens. One of the first Government based sites to use WordPress!

    

Highlighting current page in WordPress Menus

Posted on September 14, 2011

By default, wp_nav_menu doesn't create a .current_page_item or .current-menu-item class for certain elements in a wp_nav_menu, for example if you are viewing a custom post type archive or single page.

Here's some code to fix that. Bang it in functions.php

Don't forget to create your CSS classes if you already haven't done so.

Tagged as: , Continue reading

Redirecting a custom post type

Posted on September 13, 2011

Ever had to rename a custom post type? Pain in the ass. Lets just redirect it instead.

Edit your functions.php

  1. add_rewrite_tag('/<old name>/','<new name>','top');

Simple as that.

Filed under: WordPress No Comments

WP-Ecommerce documentation still sucks

Posted on September 12, 2011

WP-Ecommerce documentation still sucks.

I'm sorry too!

Filed under: WordPress No Comments
Page 3 of 3412345...102030...Last »