• Resolved M4GN3T

    (@m4gn3t)


    Since the upgrade to 3.1 i noticed that the ‘extra fields’ box while making a new article suddenly dissapeared. I want this to be turned on by default, how can i do this?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    Thread Starter M4GN3T

    (@m4gn3t)

    thats not doing it for me, i want it to be turned on without setting it in ‘screen options’. Thanks for the link though.

    Moderator keesiemeijer

    (@keesiemeijer)

    These settings in Screen Options are saved so that you can customize how your own editing screen looks.

    Thread Starter M4GN3T

    (@m4gn3t)

    thats where my problem jumps in, i dont want users to first click it and those settings aren’t saved in my situation since i don’t use the cookies from wordpress because i bridged the whole login system to vBulletin

    How to make the custom fields box be shown by default rather than hidden by default.

    (Put this in functions.php. Backup the file first. If you mess up you won’t be able to log into your site, so don’t use the editor in WordPress)

    // Change what's hidden by default
    add_filter('default_hidden_meta_boxes', 'be_hidden_meta_boxes', 10, 2);
    function be_hidden_meta_boxes($hidden, $screen) {
    	if ( 'post' == $screen->base || 'page' == $screen->base )
    		$hidden = array('slugdiv', 'trackbacksdiv', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv');
    		// removed 'postcustom',
    	return $hidden;
    }

    Thread Starter M4GN3T

    (@m4gn3t)

    Thanks works like a charm!!!

    Greetz,

    Roy
    [sig moderated as per the Forum Rules]
    /

    Moderator keesiemeijer

    (@keesiemeijer)

    Wow, nifty peace of code. I just switched to 3.1 and have just tested it. Somehow I could see the custom fields when I tried adding a new Post for the first time straight after upgrading (for testing). I thought they were disabled by default? But when I tried with Pages they where gone. Inserted your code and and, voila, they are back. Nice work Billerickson. You should make a plugin with this code!

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    I thought they were disabled by default?

    They are, unless you’ve ever set your screen-options before. The screen options are saved, per user, per screen, in the database. So if you’ve ever modified them, then that got saved for you.

    The only time the defaults kick in is if you have no screen options preferences saved in the database.

    @billerickson:

    Thanks Bill. The ability to add a post excerpt on the “Add A Post” page had disappeared, and I wanted it back. Adding your piece of code to the bottom of my theme’s “functions.php” brought it back, along with options to enable or disable other things as well. It works great!

    The WordWeaver
    http://www.endtimeprophecy.net/Blog/

    Thanks for that snippet, Bill. So for CUSTOM POST TYPES, shouldn’t something like this work? Not getting anywhere with it.

    if ( 'post' == $screen->base || 'page' == $screen->base || 'books' == $screen->base )

    This question is to billerickson I know this is a couple of weeks old, but I have the same problem and I want to try the code that you mentioned above, but where in the functions.php file should I put the code???

    Some direction would be greatly appreciated.

    Thanks.

    Moderator keesiemeijer

    (@keesiemeijer)

    You can put it anywhere in your theme’s functions.php. Try it right after the opening php tag “<?php”.

    <?php
    // Change what's hidden by default
    add_filter('default_hidden_meta_boxes', 'be_hidden_meta_boxes', 10, 2);
    function be_hidden_meta_boxes($hidden, $screen) {
    	if ( 'post' == $screen->base || 'page' == $screen->base )
    		$hidden = array('slugdiv', 'trackbacksdiv', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv');
    		// removed 'postcustom',
    	return $hidden;
    }
    // the rest of your functions.php

    Hi Everyone,

    I cannot be anymore of an admin as the installer of my self hosted WordPress. I cannot find anywhere it says Screen Options….NOWHERE

    How is it that WP can upgrade to 3.1 and not make this feature e.g post excerpt, which is now OFF by default and I cannot find Screen Options to turn it back on.

    Furthermore, the code insertion into the functions.php file only adds on the theme the Custom Fields screen even with older themes.

    Please can someone tell me where this Screen Options is?

    Thank you

    WP 3.1 FEATURED IMAGE LINK NOT SHOWING IN WP-ADMIN QUICKFIX, HALLELUA JESUS!

    4 Hours later and Heres the fix.
    Use your file manager/ftp to open WP-ADMIN directory, open EDIT-FORM-ADVANCED.PHP and change line 131 from ! is_multisite() to is_multisite(). Just remove the !(which stands for NOT). WordPress does not allow you to have featured image in WP 3.1.

    IF NOT ON LINE 131 IN YOUR EDITOR LOOK FOR THE COMMENTS THAT SAY
    // All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).

    OR

    // all taxonomies

    FULL CODE TO PASTE INTO YOUR EDITOR….

    REPLACE THIS CODE ———-:
    if ( current_theme_supports( ‘post-thumbnails’, $post_type ) && post_type_supports( $post_type, ‘thumbnail’ )
    && ( ! is_multisite() || ( ( $mu_media_buttons = get_site_option( ‘mu_media_buttons’, array() ) ) && ! empty( $mu_media_buttons[‘image’] ) ) ) )
    add_meta_box(‘postimagediv’, __(‘Featured Image’), ‘post_thumbnail_meta_box’, $post_type, ‘side’, ‘low’);

    WITH THIS CODE ————
    if ( current_theme_supports( ‘post-thumbnails’, $post_type ) && post_type_supports( $post_type, ‘thumbnail’ )
    && ( is_multisite() || ( ( $mu_media_buttons = get_site_option( ‘mu_media_buttons’, array() ) ) && ! empty( $mu_media_buttons[‘image’] ) ) ) )
    add_meta_box(‘postimagediv’, __(‘Featured Image’), ‘post_thumbnail_meta_box’, $post_type, ‘side’, ‘low’);

    presseroo

    (@presseroo)

    I still don’t get this.
    WP 3.1 now has everywhere this hidden options stuff, i ask myself what for since the older way was just fine (??) Anyway, so i tick on the PAGES overview to show Comments, than i go into a certain page and also tick on Discussions – and okay, i now see the option fields for
    Kommentare erlauben.
    Erlaube Trackbacks und Pingbacks auf dieser Seite.
    (I run a german version but you know what this is anyway)
    And i tick “Allow Comments” ON – yet, the comments box still does not show on the front end of this particular page (while all blog POSTS still show the comments box), is this the mess that we all have to rotate around with every future WP update, in my case, is this now something that requires your code into functions.php of my Theme or else…..???

    Even my hoster begins to talk badly about WP updates, can’t they produce something that works without everybody having to scramble and hassle and spend endless hours to figure out how to fix things again, after all, the main idea, wasen’t it that simple people with no html knowledge just install it and start writing contents – now we all just chase our WP tales until eternity takes us home or what??

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Extra Fields dissapeared in New Post’ is closed to new replies.