Support » Fixing WordPress » increasing the number of pages shown by default?

  • my site shows a maximum of only 5 pages by default and if I create any more than this and it displays a ‘more’ option.
    (even though there looks to be plenty of room.

    here’s the website:

    I am using a theme called: ‘my-lovely’

    there is a functions.php file (copy of which is here in .txt format:

    this page mentions a maximum menu limit like this:

    function mythemes_menu(){
    			$limit = my_menu_limit();
    			$limit = _LIMIT_;
    		$my_nav_menu = new mythemes_walker_nav_menu($limit);
    		$args = array(
    			'menu'            => '',
    			'container'       => 'div',
    			'container_class' => 'container',
    			'container_id'    => '',
    			'menu_class'      => 'container',
    			'menu_id'         => '',
    			'echo'            => false,
    			'fallback_cb'     => '',
    			'before'          => '',
    			'after'           => '',
    			'link_before'     => '',
    			'link_after'      => '',
    			'depth'           => 0,
    			'walker'          => $my_nav_menu,
    			'theme_location'  => 'menu_in_header',
    		); //menu_in_header

    and there’s also a in css – but not sure if this has anything to do with it?

    any ideas?

    thanks in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • It looks like there is an option in Admin->Appearance->My Theme Options->menu to set the number of items, but it is not saving the value.

    If you edit the functions.php, you can change this line:


    and set the number to whatever you like.

    Just be aware that any update to the theme will overwrite this change. To prevent this, you should use a Child theme.

    I amended the above and also this bit

    		var $limit = 7;

    but it didn’t work.

    also, nothing seems to happen when I click on save.
    and even reverting back to ‘4’ in the menu appearance settings in admin – fails to be saved (it seems to be stuck on ‘5’ pages).

    may install on another site and experiment with the default install.

    just done a test on a new site –
    installed a new unaltered and untouched theme (my-lovely theme) and tried amending the default ‘4’ pages to another number – it’s not possible to amend this either.

    Yet, I did manage to amend the ‘4’ to a ‘5’ on my first site!

    It can’t even be amended to a lower page number.

    The width is not a problem/issue either as I have changed page names to something very long (link below) and there is plenty of room allowed in the css for this to happen:

    OK – a real hack that will disappear if you update the theme:

    In the main theme functions.php, change this:

    function my_menu_limit() {
    	return get_option('myfi_limit');

    to this:

    function my_menu_limit() {
    	//return get_option('myfi_limit');
    	return 7;

    Two more places to look:

    – in the WordPress Appearance->Menus area, make sure there isn’t a different menu actually being displayed. i.e. that function does something else menu related, or is deprecated, and isn’t actually controlling that area.

    – the code that generates that part of the page: check that someone didn’t hard code a value in there. If you can read the PHP this is the way to be certain what it’s doing. You might post that part of code if it’s unexpected looking.

    thanks for the posts.
    Editing this bit:

    function my_menu_limit() {
    	//return get_option('myfi_limit');
    	return 7;

    did actually fix the issue on the test site.

    On my original site, yes Shastaw, it looks like this is not being used – as i’m using a custom menu (just can’t see where to edit it though) – there are no settings in the admin area to modify the number of pages displayed on a custom menu.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘increasing the number of pages shown by default?’ is closed to new replies.