How To Add Private Pages In Navigation Menu Of WordPress Blog

Posted by


If you are using private pages and want to display then in navigation menu then use this hack. For that open the file where your navigation code is and add this code:

if(current_user_can(‘read_private_pages’)) :
<li><a href=”<?php echo get_permalink(10); ?>”>For Authors only</a></li>
<?php endif; ?>

Now, navigation menu displays private pages when specific user is login into blog.

That’s it!


Shane G.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.