what's the difference between the two?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mkyb14
Forum Newbie
Posts: 12
Joined: Sat May 28, 2005 7:46 pm

what's the difference between the two?

Post by mkyb14 »

ok after looking at some code on a wordpress template i noticed that the author used

Code: Select all

<?php get_footer(); ?>
now i've been using

Code: Select all

<?php include 'footer.php'; ?>
what's the difference?
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post by dethron »

what is get_footer() ? it is not a built-in function while include is a standard function.
mkyb14
Forum Newbie
Posts: 12
Joined: Sat May 28, 2005 7:46 pm

i dunno then

Post by mkyb14 »

it was in the page and i couldn't find any code that called it, so it must me something he wrote.. but include does just fine.
facets
Forum Contributor
Posts: 273
Joined: Wed Apr 13, 2005 1:53 am
Location: Detroit

Post by facets »

perhaps there is an include functions.php call somewhere which has the get_footer() function in it.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Try doing a "find in files" to hunt the function down. Your editor should be able to do that.
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

dethron wrote:what is get_footer() ? it is not a built-in function while include is a standard function.
You are right, get_footer() is not a built-in function. However, it is defined as part of Wordpress.

From everything I've read on the wordpress wiki the only difference between using the built-in include function and the wordpress include tags is that the wordpress include tags include specific files whereas with include you have to pass an argument with the file name. You may want to reference the Wordpress Codex Wiki to make sure.

Hope this helps.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

If on a *nix (or you happen to have "grep for windows") then from the root of the package...

Code: Select all

bash -$ grep 'function get_footer' ./*
*Should* show you where it is ;)
Post Reply