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

/—code php
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 »“:http://www.farinspace.com/page-specific-wordpress-meta-box/

Změna umístění pozice obsahového editoru nebo metaboxu v administraci

**How to Move and Position The WordPress WYSIWYG Visual Editor**
„http://www.farinspace.com/move-and-position-wordpress-visual-editor/“:http://www.farinspace.com/move-and-position-wordpress-visual-editor/

**Move excerpt meta box to above content editor**
„http://wordpress.stackexchange.com/questions/137571/move-excerpt-meta-box-to-above-content-editor“:http://wordpress.stackexchange.com/questions/137571/move-excerpt-meta-box-to-above-content-editor

**Move custom meta box above editor**
„http://wordpress.org/support/topic/move-custom-meta-box-above-editor“:http://wordpress.org/support/topic/move-custom-meta-box-above-editor

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

**Advanced Custom Fields**
„http://wordpress.org/plugins/advanced-custom-fields/“:http://wordpress.org/plugins/advanced-custom-fields/
„http://www.advancedcustomfields.com/“: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/plugins/advanced-custom-fields-limiter/“:https://wordpress.org/plugins/advanced-custom-fields-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/plugins/search.php?q=Advanced+Custom+Fields

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

Defaultní viditelnost či skrytí „zobrazených informací (screen options); metaboxů“:http://codex.wordpress.org/Administration_Screens#Screen_Options lze trvale – bez rozklikávání boxu – nastavit přidáním následujícího kódu do functions.php:

/—code 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ě“:http://pastebin.com/wsN2F8XS.

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

/—code php
add_post_type_support( ‚page‘, ‚excerpt‘ );
\—

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

„Custom post types in WordPress »“:http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress

„A refresher on custom taxonomies »“:http://justintadlock.com/archives/2010/06/10/a-refresher-on-custom-taxonomies

„Introducing WordPress 3 Custom Taxonomies »“:http://net.tutsplus.com/tutorials/wordpress/introducing-wordpress-3-custom-taxonomies/

„Innovative Uses of WordPress Post Types and Taxonomies „:http://wp.tutsplus.com/tutorials/theme-development/innovative-uses-of-wordpress-post-types-and-taxonomies/

„Custom Fields 101: Tips, Tricks, and Hacks »“:http://www.wpbeginner.com/wp-tutorials/wordpress-custom-fields-101-tips-tricks-and-hacks/

„Publish Action Hook for Custom Post Types »“:http://pippinspages.com/tutorials/publish-action-hook-for-custom-post-types/

„WordPress Custom Taxonomy Input Panels »“:http://www.shibashake.com/wordpress-theme/wordpress-custom-taxonomy-input-panels

„Revisiting Custom Post Types, Custom Taxonomies, and Permalinks »“:http://mondaybynoon.com/2011/05/20/revisiting-custom-post-types-taxonomies-permalinks-slugs/

„WordPress Custom Post Type Code Generator »“:http://themergency.com/generators/wordpress-custom-post-types/

**“Jak vytvořit vlastní metabox »“:http://www.deluxeblogtips.com/2010/04/how-to-create-meta-box-wordpress-post.html**

**“How To Create Custom Post Meta Boxes »“:https://www.smashingmagazine.com/2011/10/create-custom-post-meta-boxes-wordpress/**

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.

[* http://3.bp.blogspot.com/_Mt4qyhflsHY/S9XKl_VkMhI/AAAAAAAAAio/OK9s8GWmIaM/s1600/post-screen.png 645×525 *]

Viz též „Add A Meta Box In WordPress »“:http://wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/

**Custom Post Type UI**
„http://wordpress.org/extend/plugins/custom-post-type-ui/“:http://wordpress.org/extend/plugins/custom-post-type-ui/
„http://webdevstudios.com/support/wordpress-plugins/“:http://webdevstudios.com/support/wordpress-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/extend/plugins/easy-post-types/“:http://wordpress.org/extend/plugins/easy-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/extend/plugins/post-type-switcher/“:http://wordpress.org/extend/plugins/post-type-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/attachment/navigation menu is possible but turned off by default

**Convert Post Types**
„http://wordpress.org/extend/plugins/convert-post-types/“:http://wordpress.org/extend/plugins/convert-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“:http://justintadlock.com/archives/2010/07/16/a-wordpress-forum-plugin-using-custom-post-types
„The Essential Guide to WordPress 3.0 Custom Taxonomies“:http://www.1stwebdesigner.com/wordpress/essential-guide-wordpress-custom-taxonomies/

„First Impressions of Custom Post Type“:http://wpengineer.com/impressions-of-custom-post-type/
„Function Reference/register post type“:http://codex.wordpress.org/Function_Reference/register_post_type
„Custom Post Types in WordPress 2.9“:http://www.hostscope.com/templature/custom-post-types-in-wordpress-2-9/
„How To Make WordPress An CMS With Different Post Types“:http://www.knowtebook.com/how-to-make-wordpress-an-cms-with-different-post-types-1627.htm
„Developing Post Types Plugin with WordPress“:http://www.packtpub.com/article/developing-post-types-plugin-with-wordpress
„How to Set Up Custom WordPress Category Templates“:http://mattmedia.net/2007/10/09/how-to-set-up-custom-wordpress-category-templates-in-four-easy-steps/
„Creating single post templates in WordPress“:http://justintadlock.com/archives/2008/12/06/creating-single-post-templates-in-wordpress
„WordPress Single Post Templates“:http://www.nathanrice.net/blog/wordpress-single-post-templates/