• On my homepage I would like to add a “Post New” link which appears when logged in. My WordPress blog is stored in a sub-directory in my website:

    wwwroot/
    –> news/
    ——> wp
    –> index.php

    I have added the following into “index.php”, but it doesn’t appear to be working:

    <?php require $_SERVER['DOCUMENT_ROOT'].'/news/wp-blog-header.php'; ?>
    
    <?php if ( current_user_can('publish_posts') ): ?>
        <div class="user-controls right">
        	<a href="news/wp-admin/post-new.php">Post New</a>
        </div>
    <?php endif; ?>

    Many thanks,
    Lea Hayes

Viewing 1 replies (of 1 total)
  • Thread Starter Kruncher

    (@kruncher)

    I have found that the above script works for page templates, but when integrating into custom pages (above the WordPress directory) that simply nothing happens.

    Am I missing a “requires”?

Viewing 1 replies (of 1 total)
  • The topic ‘Adding “Post New” On Home Page’ is closed to new replies.