The MU forums have moved to WordPress.org

Default Pages & Content (43 posts)

  1. indojepang
    Member
    Posted 15 years ago #

    100% PERFECT MRBRIAN SIR!!!
    THANKS IN A MILLION!!! more than words from me.. really appreciate your help.. thank u..

  2. bbrey
    Member
    Posted 15 years ago #

    I can't seem to figure out how to set a particular template page to the page that gets auto-created on signup.. The name of the template file name is "page-gallery.php", the template name is "gallery"

    Here's the code for creating the new gallery page on registration.

    $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, post_status, post_type, to_ping, pinged, post_content_filtered) VALUES ('$user_id', '$now', '$now_gmt', '".$wpdb->escape(__('[gallery=1]'))."', '', '".$wpdb->escape(__('gallery.'))."', '0', '".$wpdb->escape(__('gallery'))."', '$now', '$now_gmt', 'publish', 'page', '', '', '')");

    Please help! Thanks a bunch!

    Brian

  3. MrBrian
    Member
    Posted 15 years ago #

    I posted the code for that just a few replys up.

  4. bbrey
    Member
    Posted 15 years ago #

    How do i go about getting what the post_id is for the new page that's gets created?

    I'm assuming i add that query directly below the code for creating the default page in wpmu_functions.php file.

    Also, in the example you provided, does the template name go in the '_wp_page_template' section as shown below?

    $wpdb->query("insert into $wpdb->postmeta (post_id,meta_key,meta_value) values ('15','_wp_page_template','templatefile.php')");

    Thank you very much Brian for your help!

    - Brian

  5. bbrey
    Member
    Posted 15 years ago #

    bump

  6. lunabyte
    Member
    Posted 15 years ago #

    wpdb->insert_id.

  7. bbrey
    Member
    Posted 15 years ago #

    where would i incorporate that into the wpmu-functions.php file.. heres my current code, with the addition of Mr. Brian's code?

    // Second auto create page
    $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, post_status, post_type, to_ping, pinged, post_content_filtered) VALUES ('$user_id', '$now', '$now_gmt', '".$wpdb->escape(__('page content example'))."', '', '".$wpdb->escape(__('work'))."', '0', '".$wpdb->escape(__('work'))."', '$now', '$now_gmt', 'publish', 'page', '', '', '')");

    // Assign template to second page
    /$wpdb->query("insert into $wpdb->postmeta (post_id,meta_key,meta_value) values ('15','work','page_work.php')");

    Thank you so much!

    Brian

  8. lunabyte
    Member
    Posted 15 years ago #

  9. bbrey
    Member
    Posted 15 years ago #

    Fantastic! Figured it out! :)

    Thank you very much!

    Brian

  10. indojepang
    Member
    Posted 15 years ago #

    somebody has got to make tutorial of this, cause it's great! dedicated to Mr.Brian sir, Lunabyte, Andrea, drmiketemp

    Calling for wpmu tutorials!!! :)

  11. benlagrone
    Member
    Posted 15 years ago #

    I've been unable to make this work, has there been some version upgrade that overwrote the wpmu-functions.php file? I'm using 2.70

  12. andrea_r
    Moderator
    Posted 15 years ago #

    I wish the search worked better and was pointed to the right search page from the main page.

    benlagrone - there are now plugins available to handle this, as well as optins for default content under Site Admin -> Options menu.

  13. benlagrone
    Member
    Posted 15 years ago #

    Thanks Andrea!
    I updated to 2.7.1 and found options to specify the default post, etc.

    I don't see it in the upgrade, is there any way to set default pages on a new user set up?

    Thanks again.

About this Topic

  • Started 16 years ago by Jshwaz44
  • Latest reply from benlagrone