TELL Communications Limited
asked 10 years ago

I was trying to improve the website speed by adding a particular code to the function.php.
The code I needed to added was meant to be added just before the “?>” tag at the end of the “function.php” file of the theme.
Yet to my surprise I realised that there was no general closing “?>” in the file. Is this a programming choice.
Would I break anything by simply adding the needed code at the end of the “function.php” as stated earlier.
 
Your response is appreciated.
 
Regards

1 Answers
DominicStaff
answered 10 years ago

Hello Damilarelana !
Anywhere in the  functions.php must start with an opening php tag and not closing “?>” tag looks like:

 <?php

If you want to add the code to the funtionc.php,  please put in another opening php tag… like:

 
 <?php<br />existing code<br /><?php<br />new code you pasted<br />?>

Hope this helps!

damilarelana
replied 10 years ago

thanks …

damilarelana
replied 10 years ago

what if the code to be added is a "function" does it matter if its enclosed in php tags (as you suggested) … I ask this because I notice that a few other functions used by the theme was not enclosed in php tags within the same file.

Powered by DW Question & Answer Pro