Add privates pages in navigation menus

/ Published in: PHP
Save to your folder(s)

Copy this code and paste it in your HTML
  1. <ul>
  2. <?php
  3. wp_list_pages('depth=1&title_li=0&sort_column=menu_order');
  4. if(current_user_can('read_private_pages')) :
  5. ?>
  6. <li><a href="<?php echo get_permalink(10); ?>">For Authors only</a></li>
  7. <?php endif; ?>
  8. </ul>


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.