繁体   English   中英

从Wordpress博客链接到静态HTML页面

[英]Linking to static html pages from wordpress blog

我有一个静态站点,其中有几页,并且安装了Wordpress。 我将wordpress上传到服务器,并且可以使用链接href =“ blog \\”从任何静态页面访问它。 静态html页面存储在服务器的主目录中,该主目录也是博客的存储位置。 该目录如下所示:

public_html/   //Server directory
-index.html
-contact.html
-about.html
-blog/         //Folder with blog installation
--wp-content/
---themes/
----theme_name/ 
-----file_with_links.php

我试图将链接放在php文件“ file_with_links.php”中,该链接将链接回到静态html页面,该页面位于该页面的上方。 我尝试使用../../../../../page.html,但没有运气。 是否有捷径可寻? 任何帮助,将不胜感激。

-谢谢

最佳做法是使用完整的URI( http://YourSiteHere.com/YourFileHere.html )。

为此,请在您的file_with_links.php文件中使用以下代码:

$root_toot = "http://YourSiteHere.com";

$to_contact = '<a href="' . $root_toot . '/contact.html">Contact</a>';
$to_about = '<a href="' . $root_toot . '/about.html">About</a>';

等等。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM