I want to add only 5 or 6 pages in my footer menu, but won't effect that into other menus like as header menu. Whole things need to do with coding not by using php.ini or .htaccess files.

Note: If anyone try to add more than 5 or 6 pages then it will not take without editing the code.

thanks in advance.


can you describe your question in more detail.

what i understand that if you want to show 4 to 5 fix pages in footer menu then you can do using get_permalinks by page id of that page.something like below. replace page id with your page ids in both get_permalink() and get_the_title().

Example :

 <li><a href="<?php echo get_permalink(1); ?>" title="<?php echo get_the_title( 1 ); ?>"><?php echo get_the_title( 1 ); ?></a></li>
 <li><a href="<?php echo get_permalink(2); ?>" title="<?php echo get_the_title( 2 ); ?>"><?php echo get_the_title( 2 ); ?></a></li>
 <li><a href="<?php echo get_permalink(3); ?>" title="<?php echo get_the_title( 3 ); ?>"><?php echo get_the_title( 3 ); ?></a></li>
 <li><a href="<?php echo get_permalink(4); ?>" title="<?php echo get_the_title( 4 ); ?>"><?php echo get_the_title( 4 ); ?></a></li>
 <li><a href="<?php echo get_permalink(5); ?>" title="<?php echo get_the_title( 5 ); ?>"><?php echo get_the_title( 5 ); ?></a></li>

Hope it will help you.

  • I want to set limit dynamically not to hard code – Fameless Nov 6 '17 at 10:10

There is an option to create a new menu in Appearance > Menus. You can create a new menu, add as many pages as u like in it and call the menu in the footer. This will not affect anything else.

Let me know if you need any more help with this.

  • I want to add item limit here. If anyone try to add more that five items then it won't take. – Fameless Nov 6 '17 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.