charlie
charlie

Reputation: 481

HTML title tag not showing on website

I have my index.php page with a php include of settings.php right at the top and then under this, standard HTML code:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Title</title>
  </head>
</html>

in settings.php i have this script included:

<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="https://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

The page title is not showing, however if i remove th jquery file:

<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>

the title shows fine, no problem.

If i check the source code of the website, the title tag shows fine too but its just not displaying when the jquery file is included

Upvotes: 0

Views: 2698

Answers (2)

Daan
Daan

Reputation: 598

The script, and thus the <?php include('...') ?> should be inside your head element.
Try the following:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <?php include ('settings.php') ?>
    </head>
</html>

Upvotes: 0

JLF
JLF

Reputation: 2360

jQuery script should be in and at the bottom of your <head> or in your <body> not before your <html> element. That will create issues beyond your no title.

Try putting your settings.php include at the bottom of your <head>.

Upvotes: 2

Related Questions