wordpress 设置只有注册用户才能浏览特定的内容

我们增加一个自定义字段:user_only,如果这个值不为零,这这篇日志或者页面是只能给注册用户浏览,然后通过 the_content 来控制内容显示,这样能简单的并且灵活设置具体到哪篇文章或者页面是只能注册用户浏览。详细代码如下:



You may also like...

1 Response

  1. Kayo says:

    WordPress 的自定义域果然是它最强大的功能!

Leave a Reply

Your email address will not be published. Required fields are marked *

five + 1 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">