website that runs using WordPress is to actually show different headers on different - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 09-05-2011, 03:01 AM   #1 (permalink)
Junior Member
 
Join Date: Aug 2011
Posts: 11
Default website that runs using WordPress is to actually show different headers on different

One of the things that you might have wanted to do if you have a website that runs using WordPress is to actually show different headers on different pages of your website. For example, you might want to show a certain header on your homepage and then a different header on the rest of your website. This header might want to have links to Facebook or Twitter etc.

Doing this is actually relatively easy to do, despite many of the online tutorials saying that it isn’t. So here’s what you do:

The very first thing that you need to do is to actually create a copy of your header file. This means that you need to download the header.php file that is currently being used using an FTP client. After this, rename the file as header2.php or something like that and re-upload it to the server. Make sure it’s the same directory as the location of the original file.
Next, you need to login to WordPress through your admin panel and then click ‘Appearance’ then ‘Editor’. Then, you need to click the file named


‘single.php’ which is one the list on the right hand side of the screen.
After you click this, you should see the HTML content of that particular file and now, you need to location the <?php get_header(); ?> part of the code.
Once you have found this snippet of code in the page, you need to actually replace it with <?php include(TEMPLATEPATH.’/header2.php’); ?>
Once you have done this, you will simply need to save the changes that you have made and then check your site to see if it has worked. If it has worked, you should see the header2 show up on the homepage whereas the original header will show up on the other pages. You can then edit header2 as you wish so that it shows up as you like on the homepage.

It really is that simple and there are a variety of cool things you can do by doing this on your website. We will leave it to you to get creative with the idea now.

shrnmlss
shrnmlss6 is offline   Reply With Quote
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 05:00 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting