
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>人生译站　woblog &#187; Wordpress</title>
	<atom:link href="http://www.bywzy.com/tag/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bywzy.com</link>
	<description>静听心曲而不谈风情,涵容悲喜而不越雷池!</description>
	<lastBuildDate>Sun, 08 Jan 2012 13:34:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WordPress　页面跳转　页面菜单</title>
		<link>http://www.bywzy.com/studynote/wordpress-page-menu.html</link>
		<comments>http://www.bywzy.com/studynote/wordpress-page-menu.html#comments</comments>
		<pubDate>Tue, 27 Oct 2009 05:50:16 +0000</pubDate>
		<dc:creator>bywzy</dc:creator>
				<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[页面菜单]]></category>
		<category><![CDATA[页面跳转]]></category>

		<guid isPermaLink="false">http://www.bywzy.com/?p=1050</guid>
		<description><![CDATA[功能描述：将导航栏添加的页面直接引导到一个链接，链接任意网页和页面。 在网上找到了两种解决方式： 方式一： 　　只需要创建一个命名为Redirect.php的文件，内容如下： 然后把这个文件上传到Wordpress中所使用的主题的根目录下（比如/wp-content/themes/主题目录）。 　　接下来，按照正常方式创建一个页面，并在创建页面底部的 “页面模板“选择Redirect。在页面中，除了你的链接，其它什么内容都不要填。然后发布页面即可。 方法2： 自己创建一个名为link to.php的文件，内容如下： &#60;?php /* Template Name: link to */ ?&#62; &#60;script&#62;location=”要跳转的地址”;&#60;/script&#62; 然后把link to.php上传至所用主题的目录下，比如用的是inove主题，就上传至/wp-content/themes/inove下面 然后你在后台创建一个页面，页面模板选择”link to”（上传那个文件后就可以出现“link to”选项），location=”你要跳转的地址”， 这样，点击页面就可以跳转到你希望的网址了。 这两个不知道那个效率更高。个人感觉第一个方便！]]></description>
			<content:encoded><![CDATA[<p>功能描述：将导航栏添加的页面直接引导到一个链接，链接任意网页和页面。</p>
<p>在网上找到了两种解决方式：</p>
<p>方式一：<br />
　　只需要创建一个命名为Redirect.php的文件，内容如下：<span id="more-1050"></span><br />
<?php<br />
/*<br />
Template Name: Redirect<br />
*/</p>
<p>if (have_posts()) {<br />
  the_post();<br />
  $pattern = '@(https?://([-w.]+)+(:d+)?(/([w/_.]*(?S+)?)?)?)@';<br />
  preg_match($pattern, get_the_excerpt(), $matches);<br />
  if ($matches[0]) header('Location: '.$matches[0]);<br />
  else echo 'Enter a URL into your page body text.';<br />
}<br />
?><br />
然后把这个文件上传到Wordpress中所使用的主题的根目录下（比如/wp-content/themes/主题目录）。</p>
<p>　　接下来，按照正常方式创建一个页面，并在创建页面底部的 “页面模板“选择Redirect。在页面中，除了你的链接，其它什么内容都不要填。然后发布页面即可。</p>
<p>方法2：<br />
自己创建一个名为link to.php的文件，内容如下：<br />
&lt;?php<br />
/*<br />
Template Name: link to<br />
*/<br />
?&gt;<br />
&lt;script&gt;location=”要跳转的地址”;&lt;/script&gt;<br />
然后把link to.php上传至所用主题的目录下，比如用的是inove主题，就上传至/wp-content/themes/inove下面<br />
然后你在后台创建一个页面，页面模板选择”link to”（上传那个文件后就可以出现“link to”选项），location=”你要跳转的地址”，<br />
这样，点击页面就可以跳转到你希望的网址了。</p>
<p>这两个不知道那个效率更高。个人感觉第一个方便！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bywzy.com/studynote/wordpress-page-menu.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

