Embed Latest Video from Channel

My Previous post about doing this was using a previous api and using callback to get the info.

Thanks to Shix_ for pointing it out there is a easier way to do this.

Simply drop this html into the place where you want the video and change the username with your username and its done.

<iframe width="300" height="200" src="http://www.youtube.com/embed?max-results=1&controls=0&showinfo=0&rel=0&listType=user_uploads&list=YOUR_USERNAME_HERE" frameborder="0" allowfullscreen="allowfullscreen"></iframe>

Even Responsive Inline Divs

Phew what a long time ago I posted.. Time to get back into it with a little responsiveness.

So you want to align divs next to each other evenly and have it responsive.. no problem!

The problem is by using 4 divs next to each other with text in, you have to apply the styling to only the inline divs and that can cause some headaches.. not going into it. The solution.

Continue reading “Even Responsive Inline Divs”

.htaccess url rewrite with http:// and https://

I thought I would share this, if anyone ever came across this.

Scenario

We had a online shop on a http:// domain. and on the same http:// domain we had 3 other sites in sub folder lets call it /site1, /site2 and /site3 so we had:

The online shop – http://www.ourdomain.co.za/
Site 1 – https://www.ourdomain.co.za/site1
Site 2 – https://www.ourdomain.co.za/site2
Site 3 – https://www.ourdomain.co.za/site3

Obviously our shop had categories for example http://www.ourdomain.co.za/category-1

So we decided to move the online shop to a secure site thus changing the http: to https:.
Now in a SEO perspective this is bad because google see’s this as n whole new site and you will loose your ranking, a simple 30 redirect in the index.php on the old root will tell google you have a new site but it still leaves you with a bunch of broken links because http://www.ourdomain.co.za/category-1 will not give you the category anymore it would rather take you to the new home page.. not Ideal.. So how do you redirect ALL old URL’s to the new site and there respective places and still keep Site1, Site2 and Site3 working.. We use .htaccess.

Continue reading “.htaccess url rewrite with http:// and https://”

Import Blog Posts into Blog Manager ( Open Cart )

Blog Manager by Echothemes doesnt have an official importer for blog posts from other platforms.

I wrote this code for my own use but I am sure it can be applied to most external blog systems as it works with the rss feed of a blog and makes use of the the functionality echothemes provides and vQmod.

Continue reading “Import Blog Posts into Blog Manager ( Open Cart )”

Embed latest video from youtube channel

There isnt really much documentation out there to do this but I use this method and it works well for me.

To get started include the latest jquery library inside your <head> tags

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

Next on the spot where you want to add in the video drop in the following code:

<div id="static_video"></div>
    <script type="text/javascript">
        function showLatestVid(response) {
            if(response.data && response.data.items) {
                var items = response.data.items;
                if(items.length>0) {
                    var item = items[0];
                    var videoid = "http://www.youtube.com/embed/"+item.id;
                    console.log("Latest ID: '"+videoid+"'");
                    var video = "<iframe width='300' height='225' src='"+videoid+"' frameborder='0' allowfullscreen></iframe>"; 
                    jQuery('#static_video').html(video);
                }
            }
        }
    </script>
    <script type="text/javascript" src="https://gdata.youtube.com/feeds/api/users/*YOUR USERNAME*/uploads?max-results=1&orderby=published&v=2&alt=jsonc&callback=
showLatestVid"></script>

Just change the *YOUR USERNAME* to your channel name.

That should do it.

UPDATE:

This method doesnt work anymore 🙁 , but here is the updated method: Embed latest video from channel

Add to custom post type quick edit on WordPress.

If you had the need to add options to the WordPress quick edit menu, here is the solution. In this example my custom post type will be “mytype”.
This post will assume you have a custom field already created for your post type, my customfield name will be “myfield”.

The steps are as follows:

1. Add an extra column ( wont work if you dont have the custom column present )
2. Fill the custom column with data
3. Add the form to the quick edit box
4. Add the save function
5. Add the Javascript to populate the form with current fields

So lets go:
Continue reading “Add to custom post type quick edit on WordPress.”

90% of everything is bullshit!

Everyday time is wasted by small little acts or small distractions and we don’t even realise it. Brad Frost sums it all up in this informative and entertaining video.

90% of everything is bullshit. Let’s be responsible for the 10%.

Watch it and do your best to be the best at what you do!

thanks for sharing Iaan van Niekerk

Guide to Open Cart Structure

Anyone using Open Cart would know there isnt really a good source of introduction for open cart.

Luckily I found this while search the web. Although not my own article this is a must reshare. All credit goes to Jay Gilford.

OpenCart 1.5.X developer quick start guide for beginners

This guide is written for developers already familiar with PHP, OOP and the MVC architecture

In the following, you’ll see examples for the catalog side of the cart. The admin side is identical in function with the exception of the views which is noted in the relevant section

Continue reading “Guide to Open Cart Structure”