By hornstreet on
I want to change the number of posts on my front page from 10 to 12, but the next one up is 15. How can I change it so that the drop down will offer me 12?
I want to change the number of posts on my front page from 10 to 12, but the next one up is 15. How can I change it so that the drop down will offer me 12?
Comments
That would require a custom
That would require a custom module implementing hook_form_alter() http://api.drupal.org/api/function/hook_form_alter/5.
The easiest way to do what you want might be to edit the database directly with phpMyAdmin or whatever tool is available on your server, in the table {variables} look for the variable named default_nodes_main and change it from 10 to 12. Then you need to empty (truncate) the DB table {cache} so that the change takes effect. You can also use the contrib module "devel" to do these things.
Make a DB backup first in case you have finger trouble doing this ..!
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Didn't work for me...
I tried the suggestion to change the default_nodes_main in the variables table but got a divide by zero error in includes/pager.inc
Still working on how to change the # of posts on the main page.
If the other suggestion
If the other suggestion doesnt work, the easiest way I found was to go into the file "modules/node/node.admin.inc" and add "12" to the list located around line 34:
$form['default_nodes_main'] = array(
'#type' => 'select', '#title' => t('Number of posts on main page'), '#default_value' => variable_get('default_nodes_main', 10),
'#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 20, 25, 30)),
'#description' => t('The default maximum number of posts to display per page on overview pages such as the main page.')
);
Not a correct way to do it but its a quick fix
If you are using views for
If you are using views for your frontpage then there is a setting that lets you manually enter the number of items to display. If you're not using views, then get it! :-)
number of frontpage posts to 33
I would like to change the number of post above the max of 30 (to 33).
My frontpage is not a view so I can't change it in those settings.
I tried to find the ['default_nodes_main'] in "modules/node/node.admin.inc" but that is not in that file anymore.
Does someone know how I can change it now to 33 posts without turning my frontpage into a view?
Edit:
Ah I see now that this for drupal 5 instead of drupal 7 that I have. Question remains the same though.
_
If you don't want to turn your frontpage into a view, then you can either implement hook_form_alter on the admin form if you want to make alternate values available through the ui or just edit the variable directly in the variable table (i recommend using admin_menu's 'variable editor' functionality rather than altering the db directly).