Ad

SiteMap How Add Page Out Of Wordpress Where Blog Is Situated As MySite.com/blog

- 1 answer

My WordPress blog is product site in catalog: mySite.com/blog.

I have same page in main directory. Same of them is access only to register user.

How add public pages form main directory to WordPress blog? What plugin do you recommend?

Ad

Answer

One possible answer is to create a new page (say with title wpform). Then create page-wpform.php and put all your custom php code in there. One function might help is is_user_logged_in():

<?php if(! is_user_logged_in()): ?>
  <!-- user not logged in should make the if condition true -->
  <!-- you can put any html markup here -->
  <form>
    <!-- etc... -->
  </form>

<?php endif; ?>

If you have set up your permalinks in the settings, this page should be accessible mySite.com/blog/wpform or mySite.com/wpform. I'm not completely sure if /blog is your root to wordpress.

I hope this helps.

Ad
source: stackoverflow.com
Ad