简体   繁体   中英

Linking to static html pages from wordpress blog

I have a static site with a few pages and an installation of Wordpress. I uploaded wordpress to the server and I am able to access it from any of the static pages using the link href="blog\\". The static html pages are stored in the main directory of the server which is also where the blog is stored. the directory looks like this:

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

Im trying to put links in the php file "file_with_links.php" that will link back to the static html pages which are a few directories up from it. I tried to do use ../../../../../page.html with no luck. Is there an easy way to do this? any help would be appreciated.

-Thanks

Best practice is using a full URI ( http://YourSiteHere.com/YourFileHere.html ).

To achieve this, use this code in your file_with_links.php file:

$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>';

Etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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