ltoso Posted January 10, 2010 Share Posted January 10, 2010 Hi, i am new to programming in php, i was just checking the wordpress code and found out in the wordpress code they are calling the function get_header(); at the top of every page but above calling this function their is no file included file, how is it possible, how can a function work without function defination. Please recommend Regards Ltoso Quote Link to comment https://forums.phpfreaks.com/topic/187940-re-calling-a-function-without-including-file/ Share on other sites More sharing options...
RaythMistwalker Posted January 10, 2010 Share Posted January 10, 2010 if there is no include file then the function is encoded in that page. What WP page are you talking about i could have a look and see how more i could explain this as i am currently coding a function for a client. Quote Link to comment https://forums.phpfreaks.com/topic/187940-re-calling-a-function-without-including-file/#findComment-992292 Share on other sites More sharing options...
ltoso Posted January 10, 2010 Author Share Posted January 10, 2010 hi, just download latest.tar.gz from the wordpress.org and then go into wp-content/themes/header.php you'll see that they don't have any file included into the php file and still they have used the get_header(); function Regards ltoso Quote Link to comment https://forums.phpfreaks.com/topic/187940-re-calling-a-function-without-including-file/#findComment-992316 Share on other sites More sharing options...
ignace Posted January 10, 2010 Share Posted January 10, 2010 That's because the function is included before the header.php file is called. Quote Link to comment https://forums.phpfreaks.com/topic/187940-re-calling-a-function-without-including-file/#findComment-992319 Share on other sites More sharing options...
ltoso Posted January 11, 2010 Author Share Posted January 11, 2010 hi, but there is no include or require directive before the function call you can yourself download code and check it. ltoso Quote Link to comment https://forums.phpfreaks.com/topic/187940-re-calling-a-function-without-including-file/#findComment-992560 Share on other sites More sharing options...
RaythMistwalker Posted January 11, 2010 Share Posted January 11, 2010 that file will be used as an include in another page and the other page calls the function. Quote Link to comment https://forums.phpfreaks.com/topic/187940-re-calling-a-function-without-including-file/#findComment-992633 Share on other sites More sharing options...
oni-kun Posted January 11, 2010 Share Posted January 11, 2010 hi, but there is no include or require directive before the function call you can yourself download code and check it. ltoso Yes, the current page you are viewing is a file to be included. If it isn't defined then this is obviously so. Quote Link to comment https://forums.phpfreaks.com/topic/187940-re-calling-a-function-without-including-file/#findComment-992637 Share on other sites More sharing options...
RaythMistwalker Posted January 11, 2010 Share Posted January 11, 2010 you can tell this by the fact it is in the wp-contect folder as all the user access files are in the main directory. Quote Link to comment https://forums.phpfreaks.com/topic/187940-re-calling-a-function-without-including-file/#findComment-992696 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.