The MU forums have moved to WordPress.org

showing more than 10 posts as a default (8 posts)

  1. sallam
    Member
    Posted 18 years ago #

    In blogs created by users, in the "Reading Options
    Blog Pages
    Show at most:" 10 is the pre-selected dafault value.
    How can I change this to a different number as default?
    what file to edit please?

  2. boonika
    Member
    Posted 15 years ago #

    options-reading.php I guess... hope you'll come back to read my answer... hihihihi:)

  3. boonika
    Member
    Posted 15 years ago #

    I've laughed at this poor guy and found out that it's not as easy as editing options-reading.php. Anyone knows where to search for default value of posts displayed on front page. Which .php file? I want to set this value for all future posts so I don't have to change "Blog pages show at most" for every new blog created. Thanks.

  4. Ovidiu
    Member
    Posted 15 years ago #

    there is a plugin which could help you:

    <?php
    /*
    * Plugin Name: WPMU Blog Defaults
    * Plugin URI: http://paidtoblog.com
    * Description: Change the default options for WPMU and new blogs automagically
    * Version: 1.0.2
    * Author URI: MrBrian
    */
    
    //------------------------------------------------------------------------//
    //---Remove permalinks from menu------------------------------------------//
    //------------------------------------------------------------------------//
    /*function remove_permalinks_menu_item()
    {
        global $submenu;
        if(!is_site_admin()) $submenu['options-general.php'][35] = '';
    }
    add_action( 'admin_menu', 'remove_permalinks_menu_item' );*/
    
    //------------------------------------------------------------------------//
    //---Change the permalink structure and default blogroll------------------//
    //------------------------------------------------------------------------//
    
    function change_newblog_defaults( $blog_id, $user_id )
    {
        global $wpdb, $current_site, $wp_rewrite;
        //--change permalink structure
        switch_to_blog($blog_id);
        $permalink_structure = '/%category%/%postname%/';
        $wp_rewrite->set_permalink_structure($permalink_structure);
        $wp_rewrite->flush_rules();
        $wpdb->query( "UPDATE {$wpdb->terms} SET name = 'Articles', slug = 'articles' WHERE term_id = 1" );
        //--end
    
        //--change default blogroll
        $wpdb->query( "DELETE FROM {$wpdb->links} WHERE link_id = 1" );
        $wpdb->query( "DELETE FROM {$wpdb->links}WHERE link_id = 2" );
        $wpdb->query( "INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_owner, link_rss) VALUES ('http://" . $current_site->domain . $current_site->path . "', '" . $current_site->domain . "', 1356, '$user_id', 'http://" . $current_site->domain . $current_site->path . "feed/')" );
        //--end
        restore_current_blog();
    }
    add_action( 'wpmu_new_blog', 'change_newblog_defaults', 10, 2 );
    
    //------------------------------------------------------------------------//
    //---Modify the From and email used when sending emails from WPMU---------//
    //------------------------------------------------------------------------//
    
    function change_wp_mail_from($from_email)
    {
    	return $from_email; //return whatever you want as email, i just like it as default.
    }
    add_filter( 'wp_mail_from', 'change_wp_mail_from' );
    
    function change_wp_mail_from_name($from_name)
    {
    	global $current_site;
    	return $current_site->domain;
    }
    add_filter( 'wp_mail_from_name', 'change_wp_mail_from_name' );
    
    //------------------------------------------------------------------------//
    //---Change The Help and Forum links at very top of WPMU backend---------//
    //------------------------------------------------------------------------//
    
    function change_header_navigation($header_nav)
    {
    	global $current_site;
    	$header_nav = ' | <a href="http://' . $current_site->domain . $current_site->path . 'faq/">Help</a>' . ' | ' . '<a href="http://' . $current_site->domain . $current_site->path . 'forum/">Forums</a>';
    	return $header_nav;
    }
    add_filter('admin_header_navigation', 'change_header_navigation');
    
    //------------------------------------------------------------------------//
    //---Change default widgets------------------------------------------//
    //------------------------------------------------------------------------//
    //This activates the given widgets in sidebar-1 and -2. You need to know the internal names of the widgets.
    function change_blog_widgets() {
    
       	add_option("sidebars_widgets",
    		array("sidebar-1" => array("tag_cloud"),
    			 "sidebar-2" => array("archives", "links")));
    
    }
    add_action("populate_options", "change_blog_widgets");
    ?>

    I don't know where I downloaded it from, but you can set up all kind of defaults for your new blogs :-) if you figure out what setting you need to modify...

  5. boonika
    Member
    Posted 15 years ago #

    Maybe from here:

    http://pastebin.com/f21c328aa

    Thanks. I'm already using modified parts of this plugin on my MU installations. But this won't help me cause I don't know how default number of posts is defined. And also, I'm not really a programmer so sometimes I don't see the obvious. What I need is the name of the file where default number of front page posts is defined. Someone somewhere said it is -wp-admin/upgrade-schema.php but that file don't exist there. The one in wp-includes folder is of no use.

  6. boonika
    Member
    Posted 15 years ago #

  7. Klark0
    Member
    Posted 15 years ago #

    Hope sal wasnt waiting for that answer for 2 years. :D

  8. jongala
    Member
    Posted 15 years ago #

    Heh, well, this may not be the same thing you're asking (or things may have changed since then) but you can now go to Settings > Reading and change the "Show at most N posts per page" value (v. 2.6.2).

About this Topic