Create HTML5 Vertical Endless Runner cross platform games

Using Phaser framework and other FREE software
Endless runner games are gaining more and more popularity and they are really easy to code.
I will take you by hand through the creation of a complete HTML5 vertical endless runner cross platform game with a lot of features and room for customization.
100 pages + 31 source code examples with a free update to come in a few days.

Create a “Share on Facebook” link in your WordPress blog

Emanuele Feronato Facebook, WordPress

With its over 200 millions registered users (read 200 Million Strong) Facebook can bring a lot of traffic to your blog, so in my opinion it’s very important to add a “Share on Facebook” button to your blog.

Facebook Sharer

If you noticed, Facebook as a sharer url allowing you to share a link.

I am going to use this feature to create the button.

sharer.php needs two variables to share your page: u for the link and t for the title, so we need to create a link like

http://www.facebook.com/sharer.php?u=the_link&t=the_title

WordPress functions

The function that returns URL for the permalink to the post currently being processed is the_permalink(). You can read more information about it at the official page.

The function to get the title is (guess what?) the_title. More information at the official page.

Some icons

Just in case you are looking for some interesting Facebook icons, I am giving you a couple of links:

http://csi.nfshost.com/goodies/
http://www.webfruits.it/dblog/articolo.asp?articolo=62 (this one is in italian, just go on download button at the end of the page).

If you know more links about free Facebook icons, just let me know and I’ll add them here.

The code

Time to write some code now… in your wp-content/themes/ folder of your WP installation, locate the folder of your theme and check for single.php file.

Warning: not all themes have a single.php file… if you can’t find it, then probably the right file to edit is index.php… anyway it could be the right file if you see the_content() function.

The code I suggest you to add, after the_content, is

And you’ll have your Facebook link like the one I added on my blog.

Stay up to date
Follow me on the social networks and never miss a post.

Official Emanuele Feronato Facebook page

Official Emanuele Feronato Twitter account

From null to full HTML5 cross platform game

I will take you by hand from the bare bones of JavaScript programming through the creation of a full cross platform HTML5 game, with detailed explainations and source code.

If you don't know where to start, then From null to full HTML5 cross platform game is the book for you.

Comments 26

  1. Pingback: 10 WordPress 2.7 Hacks That I Have Added This Month | Blogging | So You Want To Teach?

  2. Roger Mitchell

    This seems to be exactly what I want, but as a new user I am unable to find the wp-content/themes/ folder and therefore can’t find the single.php file.
    I go to appearance, themes and it shows my current theme at the top. Do I then go to edit CSS? Can you guide me on how to find the folder and file I need to change?

  3. Says

    Thanks for the code. I was able to place it in my wordpress theme but there’s one thing that I’m having a problem with.

    the link works fine but unlike on your site, The title of the story does not show up, neither does the sentence or two that follows the title. Instead all I get the site link and the site name.

    Here’s a screen shot of what I’m getting: http://www.phresh.cc/fb_screen.jpg

  4. Ted

    Unfortunatelly, this won’t validate:

    Whitespace in query component. Use %20 in place of spaces.

    How to use %20 for titles with spaces in between?

  5. Pingback: Willie » Create a “Facebook Share” button or link

  6. mike

    thanks for this tutorial. i was able to make the link work. but i think i missed the part where the fb icon is supposed to show up. instead only the “Share on Facebook” text is showing :( hope you can explain this part…

  7. Graig

    Have you ever considered about adding a little bit more than just
    your articles? I mean, what you say is fundamental
    and everything. However just imagine if you added some great
    visuals or video clips to give your posts more, “pop”!
    Your content is excellent but with images and videos, this blog
    could definitely be one of the very best in its field.
    Terrific blog!

  8. Jamie

    Even though this is a few years old it seems to work properly for me. Thanks, this is a very easy way to add a share button.

  9. Kassie

    My programmer is trying to convince me to
    move to .net from PHP. I have always disliked the idea because of the expenses.
    But he’s tryiong none the less. I’ve been using Movable-type on various websites
    for about a year and am nervous about switching to another platform.
    I have heard fantastic things about blogengine.net. Is
    there a way I can transfer all my wordpress posts into it?

    Any help would be really appreciated!

Leave a Reply

Your email address will not be published. Required fields are marked *