Zobrazování metaboxů pouze na vybraných stránkách

add_action('admin_init','my_meta_init');
function my_meta_init()
{
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;
// checks for post/page ID
if ($post_id == '84')
{
add_meta_box('my_all_meta_1', 'My Custom Meta Box 1', 'my_meta_setup_1', 'page', 'normal', 'high');
}
$template_file = get_post_meta($post_id,'_wp_page_template',TRUE);
// check for a template type
if ($template_file == 'home.php')
{
add_meta_box('my_meta_2', 'My Custom Meta Box 2', 'my_meta_setup_2', 'page', 'normal', 'high');
}
// add a meta box for custom page types
foreach (array('events','page') as $type)
{
add_meta_box('my_meta_3', 'My Custom Meta Box 3', 'my_meta_setup_3', $type, 'normal', 'high');
}
add_action('save_post','my_meta_save');
}

Zdroj »

Správa uživatelských polí vč. vytváření metaboxů

Advanced Custom Fields
http://wordpress.org/…stom-fields/
http://www.advancedcustomfields.com/

  • Visually create your Fields
  • Select from multiple input types (text, textarea, wysiwyg, image, file, page link, post object, relationship, select, checkbox, radio buttons, date picker, true / false, repeater, flexible content, gallery and more to come!)
  • Assign your fields to multiple edit pages (via custom location rules)

Handy add-on:

Advanced Custom Fields Limiter
https://wordpress.org/…lds-limiter/

Insert JavaScript character limiters in Advanced Custom Fields. You set a limit for each field, and a character counter will appear next to them in the admin interface. " A lot of other ACF extending plugins available »":http://wordpress.org/…s/search.php?…

Výchozí nastavení zobrazených informací (screen options)

Defaultní viditelnost či skrytí zobrazených informací (screen options); metaboxů lze trvale - bez rozklikávání boxu - nastavit přidáním následujícího kódu do functions.php:

// jak změnit, co je defaultně skryto
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', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv', 'postcustom');
        // zde odstraněno 'postexcerpt', tzn. stručný výpis příspěvku,
        // který bude nyní v editaci příspěvku viditelný stále
return $hidden;
}

screen-options
screen-options

Je rovněž možné odstranit některé metaboxy úplně.

Potřebujete-li přidat pole 'stručný výpis' i do administrace stránek, stačí do functions.php přidat

add_post_type_support( 'page', 'excerpt' );

Různé typy příspěvků, taxonomie, metaboxy

Custom post types in WordPress »

A refresher on custom taxonomies »

Introducing WordPress 3 Custom Taxonomies »

"Innovative Uses of WordPress Post Types and Taxonomies ":http://wp.tutsplus.com/…-taxonomies/

Custom Fields 101: Tips, Tricks, and Hacks »

Publish Action Hook for Custom Post Types »

WordPress Custom Taxonomy Input Panels »

Revisiting Custom Post Types, Custom Taxonomies, and Permalinks »

WordPress Custom Post Type Code Generator »

Jak vytvořit vlastní metabox »

How To Create Custom Post Meta Boxes »

Using custom meta box is a great way to make custom fields more friendly to users. It helps us much to add extra information to a post.

Viz též Add A Meta Box In WordPress »

Custom Post Type UI
http://wordpress.org/…ost-type-ui/
http://webdevstudios.com/…ess-plugins/

This plugin provides an easy to use interface to create and administer custom post types in WordPress. Plugin can also create custom taxonomies. This plugin is created for WordPress 3.0.

WP Easy Post Types
http://wordpress.org/…-post-types/

This plugin lets you take advantage of the WordPress 3.0 custom post type feature, and create your own post type. The plugin allows you to add a set of fields attached to your new post type, so that in the edit and add new windows a new box will show with the fields defined. Each field added will be saved in the WordPress Database as a custom field, so that you can take advantage of the standard WordPress query rules to list your content on the page template. Not only can you create and manage new post types but you can create and manage custom fields and meta boxes associated with a particular post type. It comes with a built-in date picker field to help with post types that are date-specific. Another key feature giving this plugin loads of potential is that it allows you manage the admin display of your created post types. For instance, if you wanted a custom field to show up in the posts list screen, you can do that.

Post Type Switcher
http://wordpress.org/…pe-switcher/

A simple way to change a post type in WordPress (one at a time). Any combination is possible, even custom post types.

  • Page to Post
  • Post to Page
  • Post to Custom
  • Post to revision/attachmen­t/navigation menu is possible but turned off by default

Convert Post Types
http://wordpress.org/…-post-types/

This is a utility for converting lots of posts or pages to a custom post type (or vice versa). You can limit the conversion to posts in a single category or children of specific page. You can also assign new taxonomy terms, which will be added to the posts' existing terms.

Další informace:

A WordPress forum plugin using custom post types
The Essential Guide to WordPress 3.0 Custom Taxonomies

First Impressions of Custom Post Type
Function Reference/register post type
Custom Post Types in WordPress 2.9
How To Make WordPress An CMS With Different Post Types
Developing Post Types Plugin with WordPress
How to Set Up Custom WordPress Category Templates
Creating single post templates in WordPress
WordPress Single Post Templates