PHP IF Statement To Display On Homepage Only

Sometimes we only want to display content on the homepage of our website. To create a php if statement to do this use the following code:

<!–?php if ($_SERVER[‘REQUEST_URI’] == ‘/’) {?–>
ENTER CONTENT FOR HOMEPAGE HERE
<!–?php ;} ?–>

Leave a Reply

Your email address will not be published. Required fields are marked *