本文介绍了在PHP网站中更改每个页面的元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



看看这个:。我用它制作了一个名为的网站。当我在谷歌上键入X Phoenix时,它不会出现在顶端,尽管我已经把它放在谷歌网站管理员身上,已经有4个月了。它无法在Google搜索中看到。在,它被写入使用不同的关键字,标题和描述为所有页面。但在我的网站中,我使用的方法是将头部和一些其他东西从身体放在名为header.php的文件中,而在footer.php中放置在我的内容下面,然后在页面放置。 home.php,我把:

 <?php include('header.php'); ?> 
我的文本
<?php include('footer.php'); ?>

我的元数据在标题中,所以我如何在每个页面中更改它。


如何编写关键词,例如xphoenix,x,phoenix,f1等


也请告诉我其他方法使我的网站在上面的谷歌,并使其看起来更好。


请给我一些关于站点地图的信息,以及如何制作它们。


如果我有名字:team x phoenix,我应该用关键字编写团队,x,phoenix还是team x phoenix

解决方案

您可以这样做:



在您home.php中

  $ meta1 ='我的元标记文字'; 
include('header.php');
回声'我的文字';
include('footer.php');

在您的header.php中,您可以这样做:

 < meta name =descriptioncontent =<?php echo $ meta1;?>> 




  • 对于seo,您可以查看以下链接:

  • 对于一个网站地图生成器,您可以请看这里:



但是我认为最好如果你只是使用谷歌。



Take a look at this: How to make webpages with the same design. I used it to make a website called X Phoenix. When I type X Phoenix on google, it doesn't come on top, although i've put it on google webmasters and it's been 4 months. It doesn't come anywhere I can see on Google Search. On this pdf, it's written that use different keywords, titles, and descriptions for all pages. But in my website, i've used the method in which i put the head and a few other things from body in a file called the header.php and things below my content in footer.php, then in a page for ex. home.php, I put:

<?php include('header.php'); ?>
my text
<?php include('footer.php'); ?>

My metas are in the header, so how am I to change it in each page.
How to write keywords i.e xphoenix,x,phoenix,f1, etc.
Also tell me other ways to make my website on top of google and make it look better good.
Please give me some info on sitemaps and how to make them.
If I have the name: team x phoenix, should I write team,x,phoenix or team x phoenix in keywords.

解决方案

You could do this for example:

In you home.php

$meta1 = 'My meta tag text';
include('header.php');
echo 'my text';
include('footer.php');

In your header.php you could do this:

<meta name="description" content="<?php echo $meta1; ?>">

  • For seo you can check this link: SEO
  • For a sitemap generator you can look here: Sitemap

But i think it is best if you'd just use google for this.

这篇关于在PHP网站中更改每个页面的元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 23:15