Answer the question
In order to leave comments, you need to log in
How to make a meta tag for a specific page if I have a header connected to it via include?
If I include a meta tag in a file with a header, then it will connect to all sites where this file is connected. How to deal with it
Answer the question
In order to leave comments, you need to log in
add condition to header file
<head>
<title>test</title>
<meta charset="utf-8"/>
<?php if(...){ ?>
< тут meta для подходящей страницы>
<?php } ?>
</head>
For example:
header.php
<html>
<head>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="style.css">
<?=$additional_meta ?? ""; ?>
</head>
<?php
$additional_meta = "<title>Как сделать meta tag для определенной страницы, если у меня шапка на нее подключается через include?</title>";
include("header.php");
?>
<body>
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question