Diễn Đàn SEO Panda - SEO Panda Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Diễn Đàn SEO Panda - SEO Panda Forum

Diễn Đàn SEO Panda Dành Cho Các SEOers Tự Do Thảo Luận SEO - SEO Panda Forum - Free SEO Forum to share your knowledge to the world
 
HomeLatest imagesSearchRegisterLog in
Search
 
 

Display results as :
 
Rechercher Advanced Search
Latest topics
» Top 10 SEO Tools ( fresh links )
How to Create Page Templates in WordPress EmptyWed Feb 04, 2015 10:56 pm by tranvanchienhn

» Bán Textlink Pr4-Pr6 (1PR9)
How to Create Page Templates in WordPress EmptyWed Feb 04, 2015 10:54 pm by tranvanchienhn

» Google’s Penguin Update: What it is, What it isn’t, and What to Do
How to Create Page Templates in WordPress EmptyTue Apr 22, 2014 3:23 pm by johnaclayton

» Free Click Bank Affiliate Tool
How to Create Page Templates in WordPress EmptyTue Apr 22, 2014 3:21 pm by johnaclayton

» SEO is Dead – Long Live SEO
How to Create Page Templates in WordPress EmptyTue Apr 22, 2014 3:17 pm by johnaclayton

» Local SEO là gì - 10 Thủ thuật Local SEO
How to Create Page Templates in WordPress EmptyWed Apr 02, 2014 3:31 pm by bao.seoinet

» Get High Rankings by Building Authoritative, Irrelevant links?
How to Create Page Templates in WordPress EmptySat Sep 21, 2013 9:32 pm by kyostyle1

» The best Engineering software
How to Create Page Templates in WordPress EmptySat Sep 14, 2013 2:12 pm by read2

» Tuxedos- Traditional Interest Trend
How to Create Page Templates in WordPress EmptyWed Sep 11, 2013 2:16 pm by taiiwin


 

 How to Create Page Templates in WordPress

Go down 
AuthorMessage
khiemsound




Posts : 1016
Points : 25115
Join date : 2012-03-27

How to Create Page Templates in WordPress Empty
PostSubject: How to Create Page Templates in WordPress   How to Create Page Templates in WordPress EmptySat Apr 21, 2012 8:45 pm

What do you do when your blog covers more than one topic (let’s say, wordpress hosting and guides on how to install Ubuntu), while your audiences all hang around on different social media sites? Seeing a Sphinn logo in the top left of your content isn’t exactly appropriate when you’re targeting Digg, right? To solve that problem, you could use multiple page templates to help improve your Diggs or Sphinns.

As part of a series of articles on advanced WordPress SEO, I’m going to show you how to create multiple page templates that feature different social media buttons in your top left hand corner. Take a look at these two different page types to get an idea of what I’m upto.
A note on conditional tagging vs creating new page templates

Before you read on: if you’re just looking to create a new page template in WordPress, read on. If you’re looking to use conditional tagging to display certain social media bottons based on a blog post category, you’ll need to go here: Only display the Sphinnit button on an SEO post. Right, let’s continue, shall we?

We’re going to create a new page template specifically to display the Sphinnit button, and repeat the process to create a page template for the Digg this button.
How to create a new page template in WordPress

We’re going to copy your page.php file, rename it, and use a little bit of PHP to tell wordpress there’s an extra page template available, which will display in the “Page Template” drop down in the page editor. Here’s what it looks like:



1) FTP to your WordPress host and navigate as follows:

public_html>wp-content>themes>your-theme

2) Copy page.php and stick it on your desktop.

3) Open the file in your favourite editor.

There’s a clever little bit of php you need to insert at the very top of the file, which can be used to name the template you’re creating. Without a name, WordPress assumes that the new file you’ve created is a default template which is not great for your pages or WordPress!

In this example, I’ve given my page template the rather imaginative title of “SEO-Content-page”. The code looks like this:

/*
Template Name: SEO-Content-page
*/
?>

Insert it before the tag.

4) Let’s finish the SEO content page. Remember the Sphinnit button? the code you need to insert into your new SEO-page.php file is as follows:



Place this code directly before the_content tag, so it looks like this:



When you’ve inserted your code, save the page.php file with a new filename, say, SEO-page.php and copy it back into your theme directory via FTP. don’t forget that your Sphinnit logo will display wherever you have set it to via the plugin settings in your wp-admin.

You now have two versions of a page template. One for SEO content and the original, untouched page.

If it’s useful, I’ve uploaded the code for my SEO-page.php which you can download here. Note I’ve created a table which has stumbleupon, reddit, mixx and digg this buttons.

When you’re ready to create a new page specifically for Digg, repeat the steps above. When you’re ready to insert your code, including the top left alignment, the Digg this button code looks like this:





Here’s the full page code for my Digg page. Hope you find it useful!
Back to top Go down
 
How to Create Page Templates in WordPress
Back to top 
Page 1 of 1
 Similar topics
-
» This Page Cannot Be Found: Check Your Error Page Headers
» Numerous Selections You Want to Create When Remodeling Your Bathroom
» What content should you add on a facebook page?
» 18 chiêu tăng fan page facebook (P1)
» SEO Onpage toàn tập Phần 1 Tối ưu hóa On page

Permissions in this forum:You cannot reply to topics in this forum
Diễn Đàn SEO Panda - SEO Panda Forum :: Search Engine Optimization :: Black Hat SEO-
Jump to: