Tutorial: Creating Custom Write Panels in WordPress

Everyone knows that WordPress is one of the most, if not the most, popular blogging systems on the internet today. With its out of the box features, plugins, and great theming community, its no wonder WordPress has been accepted as today’s standard. However, sometimes you just want to add a little more.
It seems the latest fad to hit the WordPress scene is adding thumbnails into a blog post. This is fairly easy to do with some knowledge of custom fields, but can be a little complicated if your client is new to WordPress, or blogging.
Luckily, WordPress has a solution for us. We are going to use a little something called add_meta_box.
Note: This tutorial requires both knowledge of WordPress, as well as PHP.
I shared a link in a comment that WordPress has a little tutorial for this on their site. However, it is a little incomplete, and leaves a little to be desired. So, let’s get started making our own!
Examples of Usage
To see how you can use custom write panels take a look at these couple of examples, or click the image below.
functions.php
Please excuse the indention of the code. The WordPress plugin does not like my tabs.
![]()
All of the code we are about to add will be put in functions.php. This file is included automatically in the Theme, so anything we put in here can be used throughout the theme.
To make this expandable for the future, we are going to declare all of our information in an array. This way, we can add some information to the array, and it will be automatically added to our Admin Panel.
Information Array
/* Plugin Name: Custom Write Panel Plugin URI: http://wefunction.com/2008/10/tutorial-create-custom-write-panels-in-wordpress Description: Allows custom fields to be added to the WordPress Post Page Version: 1.0 Author: Spencer Author URI: http://wefunction.com /* ----------------------------------------------*/ $new_meta_boxes = array( );
Inside of that array, we are going to add more arrays which will hold the information of the new meta box.
$new_meta_boxes = array( "image" => array( "name" => "image", "std" => "", "title" => "Image", "description" => "Using the \"<em>Add an Image</em>\" button, upload an image and paste the URL here.") );
The array is pretty self explanatory. The first value is the name of field, after that would be a standard value (in this case, it is blank, but this would be useful to store default information), and then the Title of the meta_box, ending with the description.
There are 3 functions that will be the backbone here. Let’s go ahead and declare those now:
function new_meta_boxes() {
}
function create_meta_box() {
}
function save_postdata( $post_id ) {
}
Creating the Fields
Lets work on function new_meta_boxes().
This is the function where we are going to build the actual HTML inputs. We first need declare a few variables as global. We will then be able to access them inside the function. We need to be able to access the $post variable, as well as $new_meta_boxes (our array.)
function new_meta_boxes() {
global $post, $new_meta_boxes;
}
Because all of our information is in an array, we need to loop through it all, and create an input box for each one:
function new_meta_boxes() {
global $post, $new_meta_boxes;
foreach($new_meta_boxes as $meta_box) {
}
Next we need to figure out a default value for the inputs. We can do this by checking the get_post_meta WordPress function.
function new_meta_boxes() {
global $post, $new_meta_boxes;
foreach($new_meta_boxes as $meta_box) {
$meta_box_value = get_post_meta($post->ID, $meta_box['name'].'_value', true);
if($meta_box_value == "")
$meta_box_value = $meta_box['std'];
}
This is some pretty simple PHP. We define $meta_box_value, and set it equal to get_post_meta. Next, we check to see if our variable == "" (equals nothing) meaning no data has been previously entered. If nothing has been entered, we set the $meta_box_value equal to the std value we defined in the array
Time to start building the inputs. First off, we are going to create a hidden field that we will use to verify the data later on.
echo'<input type="hidden" name="'.$meta_box['name'].'_noncename" id="'.$meta_box['name'].'_noncename" value="'.wp_create_nonce( plugin_basename(__FILE__) ).'" />';
Now we can echo the title of our Custom Input:
echo'<h2>'.$meta_box['title'].'</h2>';
Next our actual input box. This gets the value of $meta_box_value we worked out earlier.
echo'<input type="text" name="'.$meta_box['name'].'_value" value="'.$meta_box_value.'" size="55" /><br />';
Finally, just add our little description we defined in the array
echo'<p><label for="'.$meta_box['name'].'_value">'.$meta_box['description'].'</label></p>';
(All of that is still in our function new_meta_boxes() function.)
Make it Meta!
Our next function, function create_meta_box(), will actually create each of the meta boxes. We are going to be using WordPress’s add_meta_box
function create_meta_box() {
if ( function_exists('add_meta_box') ) {
add_meta_box( 'new-meta-boxes', 'Custom Post Settings', 'new_meta_boxes', 'post', 'normal', 'high' );
}
}
if ( function_exists('add_meta_box') ) {is important because this function did not exist in versions of WordPress before version 2.5. You need to on at least version 2.5 before this will work.
From WordPress.org, the function works like this:
<?php add_meta_box('id', 'title', 'callback', 'page', 'context', 'priority'); ?>
callback is the most important. That is calling our function (new_meta_boxes). context decides whether or not this field should display on the “Write > Post” page, or the “Write > Page” page. You can read more about the parameters on the WordPress site
Saving the Data
Now here’s the important part, and the part where WordPress.org is pretty vague. This function will save our data.
function save_postdata( $post_id ) {
global $post, $new_meta_boxes;
foreach($new_meta_boxes as $meta_box) {
}
}
This is our function, and we’ve started off with including a few variables. Again, we need to include $post so we have the ID of the WordPress post. Also, we have to include the $new_meta_box array, as we will loop through it again.
This next bit (inside of the foreach loop), will verify that the data we are receiving is genuine.
// Verify
if ( !wp_verify_nonce( $_POST[$meta_box['name'].'_noncename'], plugin_basename(__FILE__) )) {
return $post_id;
}
if ( 'page' == $_POST['post_type'] ) {
if ( !current_user_can( 'edit_page', $post_id ))
return $post_id;
} else {
if ( !current_user_can( 'edit_post', $post_id ))
return $post_id;
}
No we are going to define a variable that will get the data out of our fields.
$data = $_POST[$meta_box['name'].'_value'];
It gets the $_POST data from our fields we created in the previous functions.
Now the last thing to do is to decide what to do with the new data. To keep WordPress from creating a new database entry each time, a few checks need to be made. First, we try and get any information with the same key and post id. If it returns empty, we know this custom field has not been added before. So, lets add it.
if(get_post_meta($post_id, $meta_box['name'].'_value') == "") add_post_meta($post_id, $meta_box['name'].'_value', $data, true);
Next, we check to see if the new data in the field is different from any old data. If it is, we simply update the field.
elseif($data != get_post_meta($post_id, $meta_box['name'].'_value', true)) update_post_meta($post_id, $meta_box['name'].'_value', $data);
The last thing to do is delete one, if the field is left empty. This will keep our database free of any blank entries.
elseif($data == "") delete_post_meta($post_id, $meta_box['name'].'_value', get_post_meta($post_id, $meta_box['name'].'_value', true));
Now, to actually make things work, we need to “hook” WordPress. We can do this by using add_action. This simply adds our functions to a specific area of WordPress. In our case, we need to hook the admin_menu, as well as when the post is saved, save_post.
add_action('admin_menu', 'create_meta_box');
add_action('save_post', 'save_postdata');
Our Final Code
/* Plugin Name: Custom Write Panel Plugin URI: http://wefunction.com/2008/10/tutorial-create-custom-write-panels-in-wordpress Description: Allows custom fields to be added to the WordPress Post Page Version: 1.0 Author: Spencer Author URI: http://wefunction.com /* ----------------------------------------------*/ $new_meta_boxes = array( "image" => array( "name" => "image", "std" => "", "title" => "Image", "description" => "Using the \"<em>Add an Image</em>\" button, upload an image and paste the URL here.") );
function new_meta_boxes() {
global $post, $new_meta_boxes;
foreach($new_meta_boxes as $meta_box) {
$meta_box_value = get_post_meta($post->ID, $meta_box['name'].'_value', true);
if($meta_box_value == "")
$meta_box_value = $meta_box['std'];
echo'<input type="hidden" name="'.$meta_box['name'].'_noncename" id="'.$meta_box['name'].'_noncename" value="'.wp_create_nonce( plugin_basename(__FILE__) ).'" />';
echo'<h2>'.$meta_box['title'].'</h2>';
echo'<input type="text" name="'.$meta_box['name'].'_value" value="'.$meta_box_value.'" size="55" /><br />';
echo'<p><label for="'.$meta_box['name'].'_value">'.$meta_box['description'].'</label></p>';
}
}
function create_meta_box() {
global $theme_name;
if ( function_exists('add_meta_box') ) {
add_meta_box( 'new-meta-boxes', 'Brazen Post Settings', 'new_meta_boxes', 'post', 'normal', 'high' );
}
}
function save_postdata( $post_id ) {
global $post, $new_meta_boxes;
foreach($new_meta_boxes as $meta_box) {
// Verify
if ( !wp_verify_nonce( $_POST[$meta_box['name'].'_noncename'], plugin_basename(__FILE__) )) {
return $post_id;
}
if ( 'page' == $_POST['post_type'] ) {
if ( !current_user_can( 'edit_page', $post_id ))
return $post_id;
} else {
if ( !current_user_can( 'edit_post', $post_id ))
return $post_id;
}
$data = $_POST[$meta_box['name'].'_value'];
if(get_post_meta($post_id, $meta_box['name'].'_value') == "")
add_post_meta($post_id, $meta_box['name'].'_value', $data, true);
elseif($data != get_post_meta($post_id, $meta_box['name'].'_value', true))
update_post_meta($post_id, $meta_box['name'].'_value', $data);
elseif($data == "")
delete_post_meta($post_id, $meta_box['name'].'_value', get_post_meta($post_id, $meta_box['name'].'_value', true));
}
}
add_action('admin_menu', 'create_meta_box');
add_action('save_post', 'save_postdata');
Implementation
Now I bet you are wondering “now how the heck do I get information?!” Well, it’s quite simple really. You do it the same way you would for a normal custom field. We’ve been using the function already in the tutorial, get_post_meta().
So, just open up one of your theme files where you want the custom data to appear. First, let’s check to see if there is anything entered for this post. Because if there isn’t, we shouldn’t show anything (in this case, it would result in a broken image.)
<?php if(get_post_meta($post->ID, "image_value", $single = true) != "") : ?>
Now the actual image:
<img src="<?php echo get_post_meta($post->ID, "image_value", $single = true); ?>" alt="<?php the_title(); ?>" />
And to end our if statement:
<?php endif; ?>
Conclusion
As you can see, customizing WordPress is not an easy task. However, it pays off in the long run. By streamlining the User-Interface of adding custom data, you can help make your life, as well as your clients life a whole lot easier.
If you have any questions about the code above, or the tutorial in general, please do not hesitate to leave a comment below. I will do my best to help answer any questions that may arise.
Written by Spencer on October 20, 2008






Thanks for the great tutorial, I was eagerly anticipating this!
My latest post: AIGA, What About the Web Designers?
great tut! gonna try this out on a current project
[...] Spencer of Function writes a great tutorial on creating custom Write Panels with WordPress. [Link] [...]
A really comprehensive tutorial. I can see this coming in handy later on.
Good Job.
My latest post: Widgets – A call for help
Really Great tutorial! I think I’ll implement this in my next child theme!
Regards!
My latest post: Beginners Guide to installing WordPress
Thanks for this.
It does not seem to work for me though. When I visit the admin I see all of the functions.php code at the top of the page and the custom box does not appear.
Great tutorial, now a awesome follow up would be being able to use custom write panels in the front-end. This way a user can add information without having to go to the backend.
Thanks everyone. Glad you enjoyed it.
@Cosmo, add your code to Pastie and I’ll check it out.
@Ryan, I’m not really sure what you mean. You’ll always have to go into the WordPress admin panel to add the information.
I’m getting a parse error:
I’ve added the code to pastie, its line 10 thats causing it, any ideas?
http://pastie.org/296667
Amazing, stuff like this is popping up everywhere since the release of 2.5
And surely it can’t be TOO much of a job to modify your example so that a “select image” button could be added which could automatically feed the URL into the field. Although I’m certainly not brave enough to take the task on!
@Ryan: You COULD use TDO Mini Forms for your proposal. However, I don’t know how well, if at all, it links in with custom fields.
@Chris Robinson,
On line 10, you have a “}”, when it should be a “)”.
NOTE: Anyone who receives
Parse error: syntax error, unexpected '&', please check the following.In the
new_meta_boxes()function, look for$post-& gt;IDand change it to$post->ID. WordPress automatically changes it in my post.Thanks!
ok cool got it working, thanks for the quick response
the field shows up in the Write page but when I start adding content to the “Post” area and it try’s to auto save a draft, I get the following error underneath the Save & Publish buttons:
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘save_postdate’ was given in /Users/robinsonc/Sites/wordpress/wp-includes/plugin.php on line 311
Warning: Cannot modify header information – headers already sent by (output started at /Users/robinsonc/Sites/wordpress/wp-includes/plugin.php:311) in /Users/robinsonc/Sites/wordpress/wp-includes/classes.php on line 806
functions.php:
http://pastie.org/296682
if i take out the code in functions.php it works as normal
@Chris Robinson,
Make sure you don’t have any white space (spaces, tabs, etc) under your final
?>at the end of functions.phphad one hard return, took it out and I’m still getting the same error?
[...] A good solution for avoiding a confusing mess of custom fields needed to fill out the content in a complex theme: create a custom WordPress write panel. [...]
@Chris Robinson,
Check your function names.
save_postdateshould besave_postdataas you’ve previously declared that as your function name.awesome catch! works perfectly, thanks for all the help and a great tut!
Great! Glad everything seems to working, and you enjoyed the tutorial.
what would need to be done to add multiple custom fields?
@Chris,
All you need to do is add another array to our main
$new_meta_boxesarray. For example$new_meta_boxes =
array(
"image" => array(
"name" => "image",
"std" => "",
"title" => "Image",
"description" => "Using the "Add an Image" button, upload an image and paste the URL here."),
"image" => array(
"name" => "subtitle",
"std" => "Standard Post Subtitle.",
"title" => "Subtitle",
"description" => "Add a subtitle to the post..")
);
So basically you can just copy and paste the first one you added, but you need to add a “,” to separate the two.
very cool, ill give it a shot
Awesome. Going to try this soon! Too cool to be ignored
again worked awesome!
one last question i swear
how about adding a drop down?
@Crhis,
Now that is a little more advanced. Since our data is set up in an array, it is a pretty simple expansion.
You can check out this tutorial from The Undersigned to see how they used a similar technique for a custom options page in WordPress.
Basically, you set another value in the array, and then when you are looping through to create the meta boxes, you check to see what type if is based on the value in the array.
Hope that helps!
Great stuff, i may try to upgrade my theme later this week since it is using thumbs just to try this out
My latest post: Design Vocabulary – Typography Terms – Week 1
Awesome stuff. I gotta do up at my next theme and definitely gonna help things get better with custom panels!
My latest post: Leaked Pictures: Alyssa Yin Yi (Alyssa Kwan)/ Jane Lo Li (Malaysia Lim Kok Wing University
While it is still in beta unfortunately, Flutter is a plugin which offers the ability to do this to the write post or any other window. If you are doing this frequently, might be a plugin to look into.
I’m planning to try it for a recipe blog / site once 2.7 drops.
My latest post: A taste of things to come with 2.7
good tuts, thanks for sharing
shorten some part of your code
ID, "image_value", true) ) != "") :
?>
<img src="" alt="" />
fixed the
get_post_metathird parameters, you wont have to write$single = true. I’m sure that was a mistake.My latest post: Links for 2008-10-15 [ma.gnolia]
[...] Tutorial: Creating Custom Write Panels in WordPress.: A fantastic, detailed and quite useful tutorial on creating custom write panels for the WordPress Write Post page. I had written something similar for the WordPress Jobs site and it turned out to be a fantastic tool to quickly get to and add/modify Custom Fields in posts. Custom write panels are most useful for customized installations of WordPress and could be used to add many different types of information into a post both easily and quickly. The image below shows a couple of examples of custom panels and I am sure there are hundreds more. [...]
[...] ?????: Tutorial: Creating Custom Write Panels in WordPress [...]
Thanks!! I always assumed this could only be done by editing the main WP files (which I obviously, don’t want to do).
A lot of my themes have loads of Custom Fields, so this will definitely help!
[...] Function Web Design & Development [ Blog ] » Tutorial: Creating Custom Write Panels in WordPres… (tags: wordpress webdev plugin) [...]
[...] der ‘Neuen Beitrag schreiben’-Seite – wie es gemacht wird erklärt auf englisch Function… Bei BlueAnvil wird schön erklärt wie man ein accessible yet sexy searchbox mit CSS und [...]
Hi Spencer
What I meant about being able to post from the front end was like the following demo. http://dailywp.com/classipressdemo/
They have the add form on what seems to be the front-end. They also seem to be using a custom write panel.
What do you think, is this easy to do?
Ryan
Hi Spencer,
thanks for this great tutorial! It helps me a lot and I implemented it in one of my themes right away.
Just have one question:
When saving the postdata shouldn’t we ask as well if the data is not just the default ($meta_box['std'])? For people who set the default the implementation does not work right because the custom value is not empty any more after saving.
Couldn’t we delete the post meta in the function save_postdata when:
elseif($data == “” || $data == $meta_box['std'] )
Thanks again for this awesome post.
My latest post: Display Future Posts in Your WordPress Theme
[...] ???Google Syntax Highlighter for WordPress? ???????/coder ?????????????????????Javascript?????????????????????????WordPress??????????wefunction.com ??????????????????????????? Plain Text ?????????????????????? [...]
[...] Function Web Design & Development [ Blog ] » Tutorial: Creating Custom Write Panels in WordPres… (tags: wordpress tutorial php) This entry was posted in links. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL. « links for 2008-10-20 [...]
@Simon,
Well, if we delete the custom field when the data is equal to our standard value, then the standard value won’t show up, leaving our field empty, when it should have our standard value.
@Ryan,
That looks more like a custom form they’ve built. The information is most likely either sent to them in an email, or use some custom PHP and MySQL to post the information into their WP database, tricking it to think that it is an actual post made from the admin panel. That’s what I would do anyway.
[...] Collection: Tutorial: Creating Custom Write Panels in WordPress Eki.21, 2008 in WordPress news Tutorial: Creating Custom Write Panels in WordPress.: A fantastic, detailed and quite useful tutorial on creating custom write panels for the WordPress [...]
@Spencer:
Sure, you’re right. I was just thinking of a standard value like ‘Enter Image URL here’ without any output in the frontend. Thanks anyway.
My latest post: Display Future Posts in Your WordPress Theme
Oh I see what you mean. Yeah you could always add another value to the array, and with a few PHP checks, check if the field has no value yet, and display a description/example inside the actual field.
I just use the description under the actual input though.
[...] 2 – Function Web Design & Development [ Blog ] » Tutorial: Creating Custom Write Panels in WordPres… [...]
[...] to create custom write panels for the Write panel in WordPress? Look no further than this great tutorial over at We Function. Everyone knows that WordPress is one of the most, if not the most, popular blogging systems on the [...]
Great tut!
but, how can I add some custom fields in Press This page?
[...] Creating Custom Write Panels in WordPress [...]
Tutorial: Creating Custom Write Panels in WordPress…
A useful tutorial on creating custom write panels for the WordPress Write Post page, and have a example of how useful Custom Fields can be in developing a full CMS with WordPress.
……
Great tutorial! I didn’t know you could add new panels for your custom fields. Will try it out, thanks!
@ Spencer
I’ve been trying to wrap my brain around setting up a dropdown, I’ve got the array setup and working but the loop is whats throwing me.
Would the modification be done in the foreach(…) section to check and see if its a input or dropdown?
Then I would add an elseif(…) underneath the first if(…) to add the dropdown to the write panel, right?
I’m a PHP novice at best, I’ve thrown my code up on pastie:
http://pastie.org/297278
@Chris,
You need to add a new value in your array to define what type of input it will be. Just like you have:
You can do something like this:
Then in the loop:
foreach($new_meta_boxes as $meta_box) { ........ if($meta_box['type'] == "select") { // Build the select box } .......Is that what you were having trouble with?
yep that’s exactly what I needed, but in the example link you posted earlier he’s building the dropdown a little bit differently, I tried to implement his method but I came up with a Parse error.
code: http://pastie.org/297617
dropdown is line 34 – 38
thanks for all your help man, it’s really appreciated
[...] Tutorial: Creating Custom Write Panels in WordPress [...]
@Chris,
echo'<?php foreach ($value['options'] as $option) { ?>';That would be causing your parse error. Try this:
if($meta_box['type'] == "select") { echo'<select name="'.$meta_box['name'].'_noncename" id="'.$meta_box['name'].'_noncename" >'; foreach ($value['options'] as $option) { echo'<option'; if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } echo '>'.$option.'</option>'; } echo'</select>'; }A great post. Anything to make the client happy! I did notice quite a few clients having difficulties understanding this:
This is so much simpler
Thanks a lot!
My latest post: Magenta Lessons, Part 4: The Wonderful World of Public Relations
[...] Tutorial: Creating Custom Write Panels in WordPres… [...]
[...] Tutorial: Creating Custom Write Panels in WordPress [...]
Wow, thanks for the great tip. It is nice to see expert level WordPress tips once in a while. I will definitely be adding a link to this page on my own blog, and I can’t wait to try using Custom Write Panels in my own blogs. Keep up the good work.
Thanks for this great tutorial. I’ve bookmarked it
.
My latest post: Sudokool 2.0
[...] it didn’t work as planned. After many hours toil I was minutes away from using code from this tutorial (adding custom fields to the post screen using theme functions). Thankfully I landed on Custom [...]
[...] Tutorial: Creating Custom Write Panels in WordPress [...]
[...] from Function Web Design & Development wrote a very good tutorial about how to add custom write panels in WordPress. Learn how to output extra meta boxes in your write posts panel to add custom meta data to your [...]
????? ?????? ? ??????????, ??? ????????, ?? ????????.
Spencer, I love you man!
This is one of the best WP tutorials I’ve seen in quite a while. Thanks for sharing! Will definitely come in handy on my current project. I was planning on using Custom Fields, but they seem so obsolete now.
Wow. this is brilliant.
What about adding another group of meta boxes?
Say, I have a group of photo meta boxes: photo1, photo2, photo3. Then I’d like to have a group of quotes meta boxes: quote1, quote2, quote3.
How do I go about doing that?
@Khairil
You’ll probably want to loop through the meta boxes in the
create_meta_box()function. Right now, we are just creating one meta box with the content we made innew_meta_boxes()with WordPress’sadd_meta_box()function.What you are talking about would require the use of multiple
add_meta_box()‘sHope that helps out.
[...] Tutorial: Creating Custom Write Panels in WordPress.: A fantastic, detailed and quite useful tutorial on creating custom write panels for the WordPress Write Post page. I had written something similar for the WordPress Jobs site and it turned out to be a fantastic tool to quickly get to and add/modify Custom Fields in posts. Custom write panels are most useful for customized installations of WordPress and could be used to add many different types of information into a post both easily and quickly. The image below shows a couple of examples of custom panels and I am sure there are hundreds more. [...]
At a second look. Yup, adding a meta box with a group of custom fields not “a group of meta boxes”.
[...] has been a lot of buzz regarding using WordPress as a CMS lately, with many clever solutions that come up. Today, we will be a bit lazy try to use a plugin that is made precisely for [...]
Wow, this is excellent I have been looking for this type of thing for a while now, and you have hit the nail on the head. Thanks alot.
My latest post: WordPress Coolest Blog Competition
@Spencer
The dropdown shows up but the options are empty, I also added an elseif statement to the input but the dropdown gets added along with a duplicate input box. Any thoughts?
code here: http://pastie.org/301528
@Chris,
Your options need to be in an array themselves.
Try changing that to:
"options" => array("USA","Europe","Asia","Australia"),[...] materiale recente trateaz? tema câmpurilor personalizate din WordPress. Voi începe cu Tutorial: Creating Custom Write Panels in WordPress. WeFunction explic? în acest articol – nededicat încep?torilor, solicitând cuno?tin?e bune [...]
Thanks, I made the change but I’m still getting a blank dropdown?
http://pastie.org/301759
@Chris,
Try this for your function Chris. Should work fine.
http://pastie.org/301800
[...] every post then this might be a tutorial for you. Function have come up with a great tutorial for creating your own custom write panels in wordpress. Well worth a look if you use custom fields a lot in your wordpress [...]
Wow! What a wonderful tutorial. I’m already dreaming up ways I can use this. Thanks so much.
I have one quick question though: I would like some meta boxes to only be available when editing the ‘About’ page. Do you know of any way to only display a custom meta box when you are editing a page that has a specific title (best option) or uses a specific template (suitable option)?
Thanks in advance.
@Kyle
You could try something like this:
foreach($new_meta_boxes as $meta_box) { if( $post->ID == 333 ) { // Normal Stuff } else { echo'No Options for this Page'; } }You will of course need to edit the Page ID (My example shows it as 333).
You will also need to change
to
That just tells the function to show up on the “Page” page instead of the “Post” page.
@ Spencer
the dropdown is working perfect but the input textfields have disappeared?
code: http://pastie.org/302761
thanks again for all your help
@Chris,
Sorry about that. In your array, instead of using “text” as the type, you’re using “input”.
You’ll just want to change
if( $meta_box['type'] == "text" ) {to
if( $meta_box['type'] == "input" ) {@Spencer
That worked brilliantly! I didn’t even consider the possibility that WP still applies an ID to a page even if it’s being edited instead of viewed. Thanks for your help.
Now I’m going to try and add multiple fields like @Khairil was referring to. Which, thanks to your helpful reply to his question, seems entirely reasonable.
I think the most incredible part of this tutorial is how quickly and helpfully you have been answering everyone’s questions. Thanks for the time you’ve put in to helping us, it’s greatly appreciated.
Hmm… I think I’m close, but I’m getting this error:
Warning: Invalid argument supplied for foreach() in /home/.calloway/ksuchallenge/ksuchallenge.com/fresh/wp-content/themes/ksuchallenge/functions.php on line 237
So the if statement is working fine, but something is off with the foreach loop that goes through a second array I added. I’ve put my heavily-commented code on Pastie in hopes you could help out:
http://pastie.org/302941
Thanks once again!
@Kyle
You are getting that error because it believes that array does not exist. Even though it clearly does, you haven’t properly defined it in your function, so it has no access to it.
Try changing
to
That should fix you right up.
@Spencer
Just added it and it works perfectly! I feel kinda silly for missing something that simple.
Thank you so much for all your help, this is going to help my clients use their site a lot.
[...] ba?lant?lar?n? inceleyebilirsiniz. Kodlar?n tamam?n? buradan indirebilirsiniz. Kaynakça: wefunction.com, WordPress [...]
@Kyle
Glad everything is working now
@ Spencer
Awesome! Everything is working perfect. Thanks again for all the help!!
@ Spencer
In regards to what Khairil was asking would it be as simple as adding a foreach statement to loop through multiple add_meta_box()’s?
@ Spencer
Got the multiple add_meta_box()’s working, but I dunno if its the cleanest way to do it? What do you think?
code: http://pastie.org/303398
@Chris
Glad it works. I’m working on a cleaner way to set up multiple meta boxes. It’s throwing me for a loop (no pun intended), but maybe I’ll be able to figure something out.
@Spencer
I spoke too soon. It’s building and presenting everything perfectly, but it won’t save the data contained in the second array when the page/post is saved.
http://pastie.org/303772
@Spencer
I figured out another (less elegant) method of doing it, and it works great. Basically, I combined my previous two arrays and added an extra “check” parameter to each field array to check whether it should appear on page ID 2. It feels a bit like a hack, but it works.
http://pastie.org/303792
Don’t bother with my previous comment unless you’re bored/interested and thanks again… again.
[...] If you want to make it even simpler, if you have a multi-author blog with some less than knowledgeable authors, for example, you can add an extra “Thumbnail” box to the Write page, which would accept an image URL and store it in a custom field behind the scenes. (If you really want to get fancy, you could probably hook right into the Uploader.) Just follow this tutorial: Creating Custom Write Panels in WordPress. [...]
hello,
it’s à very good tutorial,
I have to create 3 Fields that i can insert and update them with Ajax, before i have create new table with 5 field (Id, Id_post, price…)
how can i do to use Ajax to insert and update this table ?
thank you
sorry i don’t speak english very well.
My latest post: Barack Slideshow : le slideshow élégant
[...] Tutorial: Creating Custom Write Panels in WordPress [...]
[...] Creating custom write panels in WordPress [...]
[...] “Tutorial – Creating Custom Write Panels in WordPress” on Wefunction.com [...]
Wow. This is a great tutorial, thanks!
Loads of info and very detailed.
Blog Bookmarked
My latest post: Google. A Power Users Guide
Hi buddy,
nice tutorials… but I’m having problem with mine… error parsing… any solutions? for that…
My latest post: Dreamweaver CS3: Image Maps
Hi,
Thanks for the excellent tutorial… I wish more people would write about advanced topics such as this!
I have set up several custom fields, all work fine except the “textarea” one, which strips out html when published… is there any way to get around this? The field will be used for inserting flash video embed code.
Cheers
Jack
@Web Buckets
Need a little more information if you want me to be able to help you. Do you have a URL to the error? What is the error? Can you show me your functions.php in Pastie
@Jack
I’ll have to play around with it later today, but I’m pretty sure I’ll end up using n2lbr, so if you want to see if you can get it to work, go for it.
Excellent Tutorial! I am going to love utilizing this in my blogs.
Thanks for the helpful tutorial.
Rachel
allwebdesignresources.com
My latest post: Robots.Txt Generators – List of Robots.Txt File Creators
[...] nice tutorial for creating custom panels in order to have a more friendly theme for your low level clients Share this [...]
[...] Creating Custom Write Panels in WordPress [...]
It works fantastically, but I was just wondering how would you set it up to accept radio buttons?
I’ve been trying desperately but to no avail.
Very cool, I wonder though, can you have it so that a particular thumbnail will be posted with every post that is under a given category? So when a user wants to post to a category it’ll give them a default thumbnail unless they specify the use of a different image?
@Mike,
I’ll have a mess with it, and get back to you.
@Chris,
You could check to see if the field is blank (nothing was specified), and if so, check it by using
in_categoryand show a certain image if it is.@Spencer,
Thanks a lot man… but, I think I’ve done it… I’m not sure since I was semi-hacking the code. It seems to work and it’s replicable. So I guess it does work.
Anyways I’ve implemented it for a menu type interface, here’s the code: http://pastie.org/312006
I’d still like your ideas and how you’d do it.
And thanks again for this awesome tutorial!
Gah! The previous pastie is just slightly incorrect… haha, shows me for trying to make it look clearer.
Anyways here’s a fixed version: http://pastie.org/312013
WOrks great! Thanks a million. Keep it up.
[...] Creating Custom Write Panels in WordPress [...]
[...] You can do some manual hard coding, like this tutorial [...]
Great tut, very useful in creating customized dashboard with desired add-ons.
My latest post: How To Get Backlinks To Your Blog
[...] Creating Custom Write Panels in WordPress – With this, you can take your WordPress to the next level and manage lots of custom content for each post. (this was used to use WordPress as a contact manager) November 17th, 2008 | Posted in Reading « Alternative Website Marketing [...]
[...] Creating Custom Write Panels in WordPress [...]
Nice Tutorial, but why not just use the “More-Fields-Plugin”?
http://wordpress.org/extend/plugins/more-fields/
[...] This detailed tutorial on creating custom write panels for the WordPress Write Post page using “add_meta_box()“ [...]
Nice tutorial. I have been using custom write panels alot recently and was wondering if there was possibly a way to create a custom write panel for a particular page template? This would be amazing!
@Jordan,
Not quite sure what you mean page template. Like only show them on a certain page?
You could try something like I mentioned a few comments up
@ Spencer
I’ve setup multiple arrays and they’re showing up but when I got to save it doesn’t save the data entered into the fields for the extra two arrays, could you take a look real quick. I’m thinking it has something to do with the save_postdata loop?
http://pastie.org/324053
The method you outlined a few comments up is great and i will be using that asap. Thanks.
Just to clarify what i was trying to say in my previous comment. I copied this from the codex to explain better than me:
“Individual Pages can be set to use a specific custom Page Template (a PHP template file, e.g., snarfer.php) you create within your Theme. This new Page Template will then override the default page.php Page Template included with your Theme.”
Thanks again
@Chris,
Yeah you are right, it is the save_postdata loop. There is a
foreachloop inside that function that loops through the array. So, as messy as it may be, you’ll really need to do three separate loops.@Jordan,
Glad that is working. If you’ve setup a page to use a custom page template, then just use the ID of that page in the code I linked you to, and it will only show up on the page you associated the custom template with.
@ Spencer
I’ve setup the three seperate save loops but still only the first is saving the data, any ideas?
http://pastie.org/324840
nevermind got it working
Hi,
Very good tutorial, very helpfull, thanx a lot !
I have a question : as these are custom fields, their values also appear in the Advanced Options > Custom Fields panel. So there are duplicates in the edit page. Or maybe I did something wrong ? I was wondering if there was a way for the Custom Fields panel not to show these particular values ?
@Seb
If you make the key part of your custom
field begin with an underscore, it won’t
show up in the custom fields panel.
_customfield
Thank you very much ! I’ve learned very interesting things today thank to you !
I used the following code that you provided to kyle to specify a specific page i wanted the custom write panel to appear on:
foreach($new_meta_boxes as $meta_box) { if( $post->ID == 333 ) { // Normal Stuff } else { echo'No Options for this Page'; } }I also want to make the add_meta_box dependant on this if statement also but when i try it, the box disappears on all pages.
My latest post: Windsor, Victoria St, SL4
@Jordan,
On the second line of that code, you need to change that
333to the ID of the page you want the options to show on.[...] Anleitung zu benutzerdefinierten Feldern (engl.) [...]
Absolutely perfect. Worked like a charm…
Would it be possible to create multiple boxes? i.e. if I wanted thumbnail options to be under a box called “Post Thumbnail” and contact e-mail information under a “Contact Information” box?
I saw up there where you would have to loop through the create box, but how would you do that?
[...] View This Article Email This To A Friend [...]
Also, this doesn’t show up when I am editing a ‘page’ rather than a ‘post’ any reason for this?
@D,
Regarding your first question, you’ll need to create another variable which holds the different box, then create another loop that loops through the array.
For the second part, you change:
to:
Or you can just add the second one right below it to add it to both pages and posts.
[...] great plugin system, and easy to use administration system, WordPress takes the cake. Using a Custom Write Panel, Custom Options, and manipulating the theme files, the possibilities are almost endless. In This [...]
[...] This detailed tutorial on creating custom write panels for the WordPress Write Post page using “add_meta_box()“ [...]
[...] Die Idee dazu stammt nicht von mir. Ich erkläre hier dieses “Plugin”. Der Dank geht an Function . [...]
Hey Spencer, I’ve read all the comments and had been of great help.
But I’ve reached a dead end for me. I’m one step back to the solution and sure you can help me.
I’m trying to condition the the panels to a certain category by the technique you where talking about some lines above, but changit post_ID to cat_ID
foreach($new_meta_boxes as $meta_box) { if( $post->cat_ID == 44 ) { // Normal Stuff } else { echo'No Options for this Page'; } }I think its the best hint I know in order to do it.
Thanks again.
PD: This updating comment thing is really cool, can you tell me the plugin?
My latest post: The Ultimate Web Design Showcase
@Bernat
try
$post->post_category:S I’m sorry, but the conditional it’s not working. Here’s the whole code:
http://pastie.org/335703
My latest post: The Ultimate Web Design Showcase
Since i already have a running blog i didnt really want to change my old customfield to somecustomfield_VALUE
Took me a time, changed stuffs here and there but what make my hair fall out (like 3 hours of reading and rereading the code) was that i had to take that boolean statement out
if ( !wp_verify_nonce( $_POST[$meta_box['name'].’_noncename’], plugin_basename(__FILE__) )) {
return $post_id;
}
Anyway i just didnt really got what those statement actually do, can u explain it better to me?
Btw u did a GREAT job here, really congratz m8
@Spencer,
Thanks for getting back with me Spencer. I am still having a few issues adding another meta box. I create a new $test_meta_boxes variable at the top which includes items in the array, then I just added a new foreach loop *within* the same function new_meta_boxes() – do I need to create a new function? Also, I added on the variable $test_meta_boxes on the other functions.
How can I get this working?
very useful tutorial, thank you so much..
My latest post: Consistency and Memorability
if I wanted thumbnail options to be under a box called “Post Thumbnail” and contact e-mail information under a “Contact Information” box?
[...] This detailed tutorial on creating custom write panels for the WordPress Write Post page using “add_meta_box()“ [...]
Could you use this custom write panel to modify the blogroll by adding a field to enter banner links instead of text links? i.e. a field to upload an image to be used in place of the text link when entering a link from the dashboard?
[...] Creating Custom Write Panels in WordPress – wefunction.com [...]
[...] ????????????????????“add_meta_box()“??? [...]
[...] ????????????????????????????????????????? ????????WordPress?????????????????????????? ?????????????“add_meta_box()“??? ????????????????????“add_meta_box()“??? [...]
Awesome tutorial! It totally came in handy for my new project.
[...] ??????????????????????????“?????????”????????????????????? WordPress ??? “add_meta_box()” ??????????????????????????????????? ??????? “add_meta_box()” ???????????????????????? [...]
[...] Creating Custom Write Panels in WordPress [...]
[...] You can do some manual hard coding, like this tutorial [...]
[...] doing it, but I really wanted something specific and light-weight. I followed along with this custom form tutorial and ended up with a simple little thing. The Hover Lyric entry [...]
thanks for this excellent post … this really helps a lot in my current project
[...] great plugin system, and easy to use administration system, WordPress takes the cake. Using a Custom Write Panel, Custom Options, and manipulating the theme files, the possibilities are almost endless. In This [...]
[...] that information aside, here’s what I did. Somehow, I found this awesome tutorial from Function on how to add custom write panels to your admin area. This thing is so unbelievably great that [...]
?????????, ????? ?? ????? ??????????. ?? ?????? ????? ?? ?????? ??????????. ?? ???? ?? ??? ???? ????-?????? ?????????, ???????? ???? ?? ?????? ????????????.
If only I could do that for myself from scratch! Very useful to know how much WordPress can be customised but there’s a steep learning curve. I guess the best advise is to start from scratch and slowly build it up to involve the functions you want to use – one at a time. I’m sure I’ll get there.
Cheers
[...] Similarly, a couple new elements have been added to posts that needed an easy-to-use interface. I started demo’ing plugins that allowed for creating user interface elements that tied into custom fields. Unfortunately, most are now geared towards WordPress 2.7, and DPS is running 2.6.5 for the time being. I ended up finding another great tutorial which demonstrated how to create custom write panels in WordPress. [...]
Thanks so much for sharing this, it’s extremely helpful! Noticed a couple problems with your “final code” section:
foreach($new_meta_boxes as $meta_box) {
$meta_box_value = get_post_meta($post->ID, $meta_box['name'].’_value’, true);
Notice the > instead of > you have that in both foreach calls.
I’m having trouble getting multiple fields in. What would be the code to use in the loop once you’ve declared the variable in the array? Here’s my code: http://pastie.org/367885
[...] Similarly, a integrate code brand code brand brand brand new elements have been combined to posts which indispensable an easy-to-use interface. I proposed demo’ing plugins which authorised for formulating user interface elements which scored equally in to law fields. Unfortunately, many have been right away geared towards WordPress 2.7, and DPS is using 2.6.5 for the time being. I finished up anticipating an additional good educational which demonstrated how to emanate law write panels in WordPress. [...]
[...] Similarly, a couple new elements have been added to posts that needed an easy-to-use interface. I started demo’ing plugins that allowed for creating user interface elements that tied into custom fields. Unfortunately, most are now geared towards WordPress 2.7, and DPS is running 2.6.5 for the time being. I ended up finding another great tutorial which demonstrated how to create custom write panels in Wor…. [...]
[...] 23rd, 2009 · No Comments Function Web Design & Development [ Blog ] » Tutorial: Creating Custom Write Panels in WordPres… It seems the latest fad to hit the WordPress scene is adding thumbnails into a blog post. This is [...]
Hey I am getting a error message and the code is pasted in on the header of the admin page. I have read through all comments and more or less copied everything in this tutorial but cant get it to work
Thanks for a great tut though.
http://pastie.org/368690
lol sorry but sorted it out myself
?????? ????? ????? ??????????? ? ?????? ? ?????? ???????. ???? ??? ???-?????? ?? ???????? ?????????? ???-?????? ??????.
crazy!! this is so amazing tutorial! i’ve been looking for this one.. Thanks alot Spencer
you really rock!!!
[...] Similarly, a couple new elements have been added to posts that needed an easy-to-use interface. I started demo’ing plugins that allowed for creating user interface elements that tied into custom fields. Unfortunately, most are now geared towards WordPress 2.7, and DPS is running 2.6.5 for the time being. I ended up finding another great tutorial which demonstrated how to create custom write panels in WordPress. [...]
[...] Similarly, a couple new elements have been added to posts that needed an easy-to-use interface. I started demo’ing plugins that allowed for creating user interface elements that tied into custom fields. Unfortunately, most are now geared towards WordPress 2.7, and DPS is running 2.6.5 for the time being. I ended up finding another great tutorial which demonstrated how to create custom write panels in WordPress. [...]
Anyone has a suggestion how to apply restrictions to this? Lets say I only want Editors to be able to use this and no one else?
This is GREAT! It works, but I have a special implementation and have not been able to figure out how to get the code to work.
Basically, I am not putting the thumbnail in the post – I am putting it in my header – I want to show the most recent photo from one specific category. (Actually, I will have two thumbnails in the header – the latest from each of 2 categories).
How can I alter the implementation code to query for the latest photo from a specific category?
[...] caso, es un plugin que afecta al administrador y se ha creado siguiendo la propuesta del tutorial Creating Custom Write Panels in WordPress. La función crea dos nuevos desplegables en los paneles del administrador, uno en el de posts y [...]
[...] Similarly, a couple new elements have been added to posts that needed an easy-to-use interface. I started demo’ing plugins that allowed for creating user interface elements that tied into custom fields. Unfortunately, most are now geared towards WordPress 2.7, and DPS is running 2.6.5 for the time being. I ended up finding another great tutorial which demonstrated how to create custom write panels in WordPress. [...]
[...] Similarly, a couple new elements have been added to posts that needed an easy-to-use interface. I started demo’ing plugins that allowed for creating user interface elements that tied into custom fields. Unfortunately, most are now geared towards WordPress 2.7, and DPS is running 2.6.5 for the time being. I ended up finding another great tutorial which demonstrated how to create custom write panels in WordPress. [...]
Hello. And Bye.
GREAT tutorial. I am using it in several sites now. However, is there a way to use it to create a custom field to embed a YouTube video? I saw JackAttack asked about it, but i never saw a definitive answer, and I just don’t know where to start.
One more thing, I added another custom field using the instructions you gave Chris above, and while it does add it to the Custom Fields drop down menu in Edit Post, in the area above (Brazen Post Settings) where it would be easier for my client to understand how to use it, there is still only one field. I can’t see how to make it show both custom fields to enter up there.
[...] Rewriting WordPress Functions: WeFunction Explores the idea of using wordpress’ add_meta_box as a means of creating seperate custom fields. I warn you it doesn’t look very easy. The tutorial is very well documented though. [...]
This is exactly what i was looking for, tanks guys
[...] Function Web Design & Development [ Blog ] » Tutorial: Creating Custom Write Panels in Wor… – [...]
[...] blog WeFunction shows us how to create extra write panels for adding extra bits to the “Write” page of the admin [...]
[...] Creating custom write panels in WordPress [...]
[...] Creating custom write panels in WordPress [...]
[...] blog WeFunction shows us how to create extra write panels for adding extra bits to the “Write” page of the admin [...]
[...] Tutorial: Creating Custom Write Panels in WordPress Everyone knows that WordPress is one of the most, if not the most, popular blogging systems on the internet today. With its out of the box features, plugins, and great theming community, its no wonder WordPress has been accepted as today’s standard. However, sometimes you just want to add a little more. [...]
Hi Spencer,
I’m bit late to the party, but I’m having some difficulties finding the source of my problem. I’d really appreciate it if you could have a quick look.
Here’s my error:
Warning: Cannot modify header information – headers already sent by (output started at /nfs/c01/h06/mnt/44344/domains/omaribrandt.com/html/v1/wp-content/themes/custommod/library/functions/project_panel.php:15) in /nfs/c01/h06/mnt/44344/domains/omaribrandt.com/html/v1/wp-admin/theme-editor.php on line 70
Here’s my code:
http://www.pastie.org/403921
Thanks for your help!
[...] blog WeFunction ??????????????????“write page” - create extra write panels [...]
[...] Crear paneles extras en tu Admin Panel de WordPress [...]
[...] Creating Custom Write Panels in WordPress [...]
[...] Backend33. Custom Write Panels in the WordPress BackendDesign blog WeFunction shows us how to create extra write panels for adding extra bits to the “Write” page of the admin area.34. WordPress as a [...]
[...] blog WeFunction ??????????????????“write page” - create extra write panels [...]
[...] Painéis personalizados WordPress [...]
[...] great plugin system, and easy to use administration system, WordPress takes the cake. Using a Custom Write Panel, Custom Options, and manipulating the theme files, the possibilities are almost endless. In This [...]
[...] blog WeFunction shows us how to create extra write panels for adding extra bits to the “Write” page of the admin [...]
[...] great plugin system, and easy to use administration system, WordPress takes the cake. Using a Custom Write Panel, Custom Options, and manipulating the theme files, the possibilities are almost endless. In This [...]
[...] las funcionalidades WordPress. WeFunction explora la idea de usar add_meta_box de WordPress como un medio de crear campos separados [...]
Hi!
This is a great tutorial! I love it, but I have stupid bug. I’m using custom field to add image, it’s just a link to image, so I have custom panel with one input like in your tutorial, and user paste there link. It’s working ok, but when user edit the post again, the custom panel is blank, link is only in custom field below, and when user just edit title and save changes, the custom field is also save as blank, and image doesn’t show on page anymore.. I think that if this custom panel have something it should load it while editing page
Sorry for my english, I hope you can help me how to fix it
cheers
Thanks a lot for this. This article very usefull for me to create wordpress themes.
My latest post: Mengembalikan GRUB bootloader di linux fedora
[...] blog WeFunction shows us how to create extra write panels for adding extra bits to the “Write” page of the admin [...]
This article was so useful!! I’m a designer not a developer and most of the time if I can’t find a plug in or widget that will do what I need, I just forget about it. I have no problem screwing around with my Word Press Theme as I back it up frequently and especially when I’m screwing around with things I shouldn’t be!
But on to my question. Do you have any plans of writing a How-To for the Subtitle? After seeing the image at the beginning of your post I thought you would touch on both the image and subtitle, but alas I was wrong.
Still a very helpful post!
Thanks a lot for this. I’m using custom field to add image, I hope you can help me how to fix it. A very helpful post!
Free Tutorial Forum
I just got a wordpress blog and this helped me out a lot on getting it setup properly. Thanks for the post!
very intresting
[...] Function Web Design & Development [ Blog ] » Tutorial: Creating Custom Write Panels in WordPress Function Web Design & Development [ Blog ] » Tutorial: Creating Custom Write Panels in WordPres…. [...]
I know from my clients that it is not very hard to work with WordPress. As to me, I have never dealed with it.
@Jeff
It’s exactly the same, I think the method used here uses echo to insert the value into the img tags, just insert the custom data into h3 tags.
I just write a tiny little image attach function to save spamming all that code in my layout.
[...] ?????????????????????????????????????????????????WordPress???????????????????????????????????????“add_meta_box()“???????????????????????“add_meta_box()“??? [...]
[...] 102. Creating Custom Write Panels in WordPress [...]
[...] case you haven’t seen it yet, create your own custom write panels in WordPress. Related, do the same thing with ExpressionEngine. (via [...]
[...] 38. Custom Write Panels in the WordPress Backend [...]
Your tutorial is great and I think it can really help me out. However, I am having a problem when trying to use a drop down box.
The drop down shows correctly with the correct text, but I can’t get it to store the value I want it to.
I am using the $wpdb->get_results() function to grab a table that I created in the database. So I want the ‘name’ value to show as the text and the ‘id’ value to be stored as the meta.
I’ve put up the part of the code that draws my select field.
http://pastie.org/440445
Any help would be EXTREMELY appreciated.
** Just as a note, using just input boxes all works just fine.
Look in your custom codes panels after you’ve used the created custom panel info.
Check the value in there and see what it says, thats the code you need to put in the loop.
Note: The code above appends ‘_value’ to any info you set.
I figured it out, I had the wrong name and id for the select field.
http://pastie.org/441308
Great Post. Thanks!
[...] ???Google Syntax Highlighter for WordPress? ???????/coder ?????????????????????Javascript?????????????????????????WordPress??????????wefunction.com ??????????????????????????? Plain Text ?????????????????????? [...]
[...] ???Google Syntax Highlighter for WordPress? ???????/coder ?????????????????????Javascript?????????????????????????WordPress??????????wefunction.com ??????????????????????????? Plain Text ?????????????????????? [...]
[...] ???Google Syntax Highlighter for WordPress? ???????/coder ?????????????????????Javascript?????????????????????????WordPress??????????wefunction.com ??????????????????????????? Plain Text ?????????????????????? [...]
nice, really nice!
we typically choose to incorporate in the back end as instructed. great post.
great! it works fine for me !
[...] great plugin system, and easy to use administration system, WordPress takes the cake. Using a Custom Write Panel, Custom Options, and manipulating the theme files, the possibilities are almost endless. In This [...]
[...] ????????????????????“add_meta_box()“??? [...]
hey bro, thanks so much for this tut, im all over it right now.
there is one thing though, in the tut you have a $post->ID where the > has been escaped and causes an error.
$meta_box_value = get_post_meta($post->ID,
not sure if anyone has said this already, there is alot of comments
thanks again.
[...] ???? ????? ??? ??????? ???? ?????? [...]
Thanks @Chris and @Spencer as i was looking to add a dropdown selector to my write panels.
You guys have made my life a little bit easier!
Thanks again.
[...] Tutorial: Creating Custom Write Panels in WordPress [...]
[...] the date to a unix timestamp and stores it in the post meta data. The plugin was derived from the Creating Custom Write Panels in WordPress tutorial on wefunction.com. A great tutorial for anyone looking to add custom write panels to their [...]
[...] i dati provenienti da eventuali moduli presenti nei panel personalizzati, è disponibile in questa pagina. Infine, la documentazione ufficiale pubblicata nella pagina del [...]
[...] 215. Creating Custom Write Panels in WordPress [...]
@ Spencer
I was trying to associate specific meta boxes to a category like you explained above but it doesnt seem to work
foreach($new_meta_boxes as $meta_box) { if( $post->post_category == 44 ) { // Normal Stuff } else { echo'No Options for this Page'; } }It just displays the else “no options” for that category, is there another way to grab the category ID?
Nevermind figured it out
I defined a variable $blogcategory from my custom admin panel then used it like so
foreach($new_meta_boxes as $meta_box) { $blogcategory = get_option('ct_blog_category', $single = true); if( in_category($blogcategory) ) { // Normal Stuff } else { echo'No Options for this Page'; } }Thanks again Spencer for the Tut!
One thing that I cant seem to remedy is whatever is echo’d out in the else is printed how ever many times as many items as you have in the array. Any ideas on how to correct this?
[...] ???Google Syntax Highlighter for WordPress? ???????/coder ?????????????????????Javascript?????????????????????????WordPress??????????wefunction.com ??????????????????????????? Plain Text ?????????????????????? [...]
Although I followed the tutorial nicely, and it kinda “works”, my backend shows me a white screen of death when I:
- try to filter the posts on category
- search for a post
- edit a post (although the edits I made get saved)
Anyone else who has this problem ?
(I ruled out other things, when I include the code in functions.php the problems appear, when I delete the code, the errors disappear)
grtz,
Tom.
[...] WordPress has a solution for us. Liam is using a little something called add_meta_box. This is a detailed and quite useful tutorial on [...]
[...] WordPress has a solution for us. Liam is using a little something called add_meta_box. This is a detailed and quite useful tutorial on [...]
[...] blog WeFunction shows us how to create extra write panels for adding extra bits to the “Write” page of the admin [...]
[...] You can do some manual hard coding, like this tutorial [...]
[...] Rewriting WordPress Functions: WeFunction Explores the idea of using wordpress’ add_meta_box as a means of creating seperate custom fields. I warn you it doesn’t look very easy. The tutorial is very well documented though. [...]
There are so many cool techniques described here, big thanks!……!….
It really does have some nice features. Great work!
My latest post: WordPress Featured Content Slideshow Gallery Plugin
I think I got some result. Thank you here.
Still this is one of the better templates I’ve seen. Thanks for sharing.
My latest post: Theme Membership Sites – Are those really useful
[...] WordPress has a solution for us. Liam is using a little something called add_meta_box. This is a detailed and quite useful tutorial on [...]
I know is kinda late, but thanks! Great tutorial!
My latest post: WP-Print – show me the link ONLY!
I was looking for something like this but had absolutely no clue where to start. Thank you so much.
[...] upload a 280×250 image, and paste the full path to the URL in the custom write panel. Thanks to this tutorial for the [...]
[...] WordPress has a solution for us. Liam is using a little something called add_meta_box. This is a detailed and quite useful tutorial on [...]
[...] ???? ????? ??? ??????? ???? ?????? [...]
Hey guys your sites is very excellent and your concept for share the knowledge but dear when i used this there is problem error showing. your tutorial is good but send me working tutorial which i can used on my blog,wordpress and also on websites.Dear you can also mail me at webmaster.aziz@gmail.com. Dear i have a websites and there is any profit if you are send me a correct tutorial. dear my websites detail is here:- website design indiaThewebsol is an India based professional Website Designing company.Thewebsol offering Web development, Ecommere, CMS, Graphic Designing, 3D Modeling, Flash Designing, Content Writing, SEO, Link Building and more.
hey guys can you give more information about your Creating Custom panels in word press.
I waiting for your positive response.
Tauqeer aziz
[...] Creating Custom Write Panels in WordPressA very detailed tutorial on creating custom write panels in WordPress using custom fields. [...]
[...] Creating Custom Write Panels in WordPressA very detailed tutorial on creating custom write panels in WordPress using custom fields. [...]
[...] Creating Custom Write Panels in WordPress [...]
[...] Creating Custom Write Panels in WordPress [...]
[...] Creating Custom Write Panels in WordPress [...]
Creating Custom Write Panels in WordPress…
Everyone knows that WordPress is one of the most, if not the most, popular blogging systems on the internet today. With its out of the box features, plugins, and great theming community, its no wonder WordPress has been accepted as today’s standard. H…
Awesome tutorial Spencer. Question though, is there a way to make a custom write admin page with the custom write panels we made, restricted to one post category?
In other words, say we had a post category called events that we had some custom panels for, like the date, but we only wanted those panels to show if the user was writing a post for the events category.
Could you make an admin page under “write post” and “write page” called “write event” that only posts to the events category and shows the write panels for events?
[...] Creating Custom Write Panels in WordPress A very detailed tutorial on creating custom write panels in WordPress using custom fields. [...]
[...] Creating Custom Write Panels in WordPressA very detailed tutorial on creating custom write panels in WordPress using custom fields. [...]
[...] Creating Custom Write Panels in WordPressA very detailed tutorial on creating custom write panels in WordPress using custom fields. [...]
[...] ??wordpress????????? wordpress????????????????????????????????????wordpress???????? [...]
[...] ???? ????? ??? ??????? ???? ?????? [...]
[...] upload a 280?250 image, and paste the full path to the URL in the custom write panel. Thanks to this tutorial for the [...]
[...] ???? ????? ??? ??????? ???? ?????? [...]
custom write admin page with the custom write panels we made, restricted to one post category?
In other words, say we had a post category called events that we had some custom panels for, like the date, but we only wanted those panels to show if the user was
[...] Creating Custom Write Panels in WordPress [...]
[...] WordPress has a solution for us. Liam is using a little something called add_meta_box. This is a detailed and quite useful tutorial on [...]
[...] You can do some manual hard coding, like this tutorial [...]
[...] 102. Creating Custom Write Panels in WordPress [...]
Thank you, great tutorials.
Yours sincerely
Thanks for the great tutorial.
Exactly what I was looking, I’ll certainly do my site, thanks to you I think it happen.
thank you
[...] WordPress has a solution for us. Liam is using a little something called add_meta_box. This is a detailed and quite useful tutorial on [...]
[...] great plugin system, and easy to use administration system, WordPress takes the cake. Using a Custom Write Panel, Custom Options, and manipulating the theme files, the possibilities are almost endless. In This [...]
How come I just now ran into this article! Could’ve used this a long time ago. Very well put!
My latest post: Create A Subscribe Bar with CSS Sprites
[...] Visit Article [...]
[...] and I’ll do my best to answer them. For an explanation on how custom fields work read this: Creating Custom Write Panels in WordPress. This entry was posted in Blog, Tutorial and tagged: Custom Fields, Tutorial, WordPress. [...]
[...] great plugin system, and easy to use administration system, WordPress takes the cake. Using a Custom Write Panel, Custom Options, and manipulating the theme files, the possibilities are almost endless. In This [...]
[...] WordPress has a solution for us. Liam is using a little something called add_meta_box. This is a detailed and quite useful tutorial on [...]
This works great, i had no problems implementing it,
but i have 1 question, do i have to upload the image in my uploads folder, because if i just link to some image, for example an image on a subdomain like images.mydomain.com/image.png..
if i enter
http://www.images.mydomain.com/imagenr1.png
is not working, shows nothing , or the default no_image.png,because i added an else there….
so, Do i realy have to upload the image??? Can i change this? How?
great great tutorial…thanks alot
My latest post: Exam k boojh ne
Hi there Spencer, great tutorial! Thanks so much.
I was reading the comments between you and Chris Robinson on creating multiple add_meta_box()’s and I’ve hit a snag.
I have two add_meta_box()’s, an input and a textarea. The input works fine, but the textarea won’t save. When I click the save or update button, the textarea ends up empty again.
Any ideas?
http://pastie.org/499790
[...] the original post: Function Web Design & Development [ Blog ] » Tutorial: Creating Custom Write Panels in WordPres… Share and [...]
[...] Function Web Design & Development [ Blog ] » Tutorial: Creating Custom Write Panels in Wor…Crear custom write panels in WordPress. [...]
great great great and awesome
My latest post: “Mark this Post favourite” plugin released
[...] Function Web Design & Development [ Blog ] » Tutorial: Creating Custom Write Panels in WordPres… [...]
hi there its really very cool keep it up
Thanks!
Is it possible to add checkboxes to it?
[...] Visit Article [...]
[...] a 280×250 image, and paste the full path to the URL in the custom write panel. Thanks to this tutorial for the [...]
Thanks for great post! Better is to implement in back end!
My latest post: website hosting
[...] Function Web Design & Development [ Blog ] » Tutorial: Creating Custom Write Panels in Wor… [...]
[...] Over on WeFunction, there is a great guide to adding options to the Write Post page. [...]
[...] be used to insert our code whenever is required. This part is based on great tutorial published by WeFunction and I strongly recommend to read it for better understanding of what we are about to do here. The [...]
[...] Over on WeFunction, there is a enthusiastic pass to adding options to the Write Post page. [...]
This is exactly what I want – thank you! I am however having problems with figuring out how to edit the functions.php file so that I can set up more than one editable area on a page. How do I do that? I need to have an editable text area and an editable submenu on the same page but I’m not quite getting how to add on to the arrays and have the output come out right within the WordPress admin.
Thanks!
My latest post: nn404 Not FoundnnnNot FoundnThe requested document was not found on this server.nnnnWeb Server at comluv.comnnnnnn
[...] WordPress has a solution for us. Liam is using a little something called add_meta_box. This is a detailed and quite useful tutorial on [...]
[...] add the page subtitles, I also coded in a custom write panel that only appears when you’re on the Edit Page [...]
[...] Read the original post: Function Web Design & Development [ Blog ] » Tutorial: Creating Custom Write Panels in WordPres… [...]
Great tutorial. Quick question. Let’s say you have two types of custom fields, one is for image URL’s and the other is for longer captions.
What if I wanted to use a multi-line input box for the longer text and I only wanted the larger text box on captions, not in the URL’s?
Is it defining a different standard to ‘std’? So this area?
if($meta_box_value == "") $meta_box_value = $meta_box['std']; ....etcand adding something like this?
if($meta_box_value == "big") $meta_box_value = $meta_box['big']; ....etcAny pointers appreciated.
good!thanks!
My latest post: THIS SCRIPT IS NO LONGER SERVING DATA. UPDATE YOUR PLUGIN
[...] blog WeFunction shows us how to create extra write panels for adding extra bits to the “Write” page of the admin [...]
[...] via 0 Comments [...]
[...] to CMS usage I’ve used the truly excellent more fields plugin in addition to coding my own write boxes. This means we can add custom content such a post images and links via the wordpress [...]
Looks very interesting. Thanks for sharing..
http://fashionshow99.spaces.live.com
My latest post: THIS SCRIPT IS NO LONGER SERVING DATA. UPDATE YOUR PLUGIN
Great!!!!! But, is there a way to exclude this option from a certain category?
Steven
Sweet tutorial, Thanks for taking the time to write it. I have a question, is it possible to create an image upload custom field. So a client wouldn’t have to copy and paste the url into the field. So it would pull from the the media library or from the users computer?
Thanks
[...] it. The good news though is that I found a tutorial explaining how to do it, which you can find on WeFunction.com. Handy [...]
[...] has been a lot of buzz regarding using WordPress as a CMS lately, with many clever solutions that come up. Today, we will be a bit lazy try to use a plugin that is made precisely for [...]
[...] Write Panels in WordPress Thursday, July 16, 2009 By Mr. WordPress Easy AdSense by UnrealTutorial: Creating Custom Write Panels in WordPress.: A fantastic, detailed and quite useful tutorial on creating custom write panels for the WordPress [...]
How do I do that? I need to have an editable text area and an editable submenu on the same page but I’m not quite getting how to add on to the arrays and have the output come out right within the WordPress admin.
My latest post: THIS SCRIPT IS NO LONGER SERVING DATA. UPDATE YOUR PLUGIN
Very awesome tutorial!
But this is only for posts and not for wordpress sites. How do I get custom fields in the site panel in wordpress?
Great….work. Thanks for sharing this post.
My latest post: THIS SCRIPT IS NO LONGER SERVING DATA. UPDATE YOUR PLUGIN
Very useful tutorial. Thank you! I will try to implement into my themes.
Your code help me so much. Very useful tutorial
[...] blog WeFunction shows us how to create extra write panels for adding extra bits to the “Write” page of the admin [...]
[...] Creating Custom Write Panels in WordPress A very detailed tutorial on creating custom write panels in WordPress using custom fields. [...]
[...] too much hassle. The solution? Custom fields! But not just custom fields, custom fields with custom write panels to make it even easier to enter information. Again, code below will get you something looking like [...]
[...] the Loop Display Your Tags in a Drop Down Menu How to Embed CSS in Your Posts With Custom Fields Creating Custom Write Panels in WordPress Did you like this post? Pass it [...]
Is it possible to make a taller scrolling box? Similar to the custom field value boxes on the create post page.
Having the courage to develop your own style and express yourself is most of the battle. After that you learn the tricks of software. One without the other does you no good at all.
Good code.Thank you for sharing.
I NEED HELP!
I edited the (awesome) code you gave us so that I can use multiple custom fields for various things. The problem arises when I save the post. Upon refresh after saving, all the fields are empty???
Any ideas???
Here’s the code I’m using…
http://pastie.org/571957
tnx so much for sharing this keep it up
Hi,
first, I would like to say that your tutorial is great and very thorough and easy to understand. I’m sure it is my slippery grasp of php know-how that is forcing me to pull my brains out. I’ve done all read and copied your code into my functions.php file and when I load the url (localhost) the in the browser I get a blank page not even an admin login (fatal error?). I’ve reached the edge of the plank. And before I jump, I thought I’d better reach out for help.
here is my code in the functions file:
‘sidebar’,
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ”,
‘after_title’ => ”,
));
register_sidebar(array(
‘name’ => ‘sidebar2′,
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ”,
‘after_title’ => ”,
));
register_sidebar(array(
‘name’ => ‘sidebar3′,
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ”,
‘after_title’ => ”,
));
register_sidebar(array(
‘name’ => ‘sidebar4′,
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ”,
‘after_title’ => ”,
));
register_sidebar(array(
‘name’ => ‘sidebar5′,
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ”,
‘after_title’ => ”,
));
}?>
array(
"name" => "image",
"std" => "",
"title" => "Image",
"description" => "Using the \"<em>Add an Image</em>\" button, upload an image and paste the URL here.")
);
function new_meta_boxes() {
global $post, $new_meta_boxes;
foreach($new_meta_boxes as $meta_box) {
$meta_box_value = get_post_meta($post->ID, $meta_box['name'].’_value’, true);
if($meta_box_value == "")
$meta_box_value = $meta_box['std'];
echo”;
echo”.$meta_box['title'].”;
echo”;
echo”.$meta_box['description'].”;
}
}
function create_meta_box() {
global $theme_name;
if ( function_exists(‘add_meta_box’) ) {
add_meta_box( ‘new-meta-boxes’, ‘Brazen Post Settings’, ‘new_meta_boxes’, ‘post’, ‘normal’, ‘high’ );
}
}
function save_postdata( $post_id ) {
global $post, $new_meta_boxes;
foreach($new_meta_boxes as $meta_box) {
// Verify
if ( !wp_verify_nonce( $_POST[$meta_box['name'].’_noncename’], plugin_basename(__FILE__) )) {
return $post_id;
}
if ( ‘page’ == $_POST['post_type'] ) {
if ( !current_user_can( ‘edit_page’, $post_id ))
return $post_id;
} else {
if ( !current_user_can( ‘edit_post’, $post_id ))
return $post_id;
}
$data = $_POST[$meta_box['name'].’_value’];
if(get_post_meta($post_id, $meta_box['name'].’_value’) == "")
add_post_meta($post_id, $meta_box['name'].’_value’, $data, true);
elseif($data != get_post_meta($post_id, $meta_box['name'].’_value’, true))
update_post_meta($post_id, $meta_box['name'].’_value’, $data);
elseif($data == "")
delete_post_meta($post_id, $meta_box['name'].’_value’, get_post_meta($post_id, $meta_box['name'].’_value’, true));
}
}
add_action(‘admin_menu’, ‘create_meta_box’);
add_action(‘save_post’, ‘save_postdata’);
?>
Thanks in advance…
Best.
sorry I didn’t copy it all. here is the first part.
if ( function_exists(‘register_sidebar’) ) {
register_sidebar(array(
‘name’ => ‘sidebar’,
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ”,
‘after_title’ => ”,
));
register_sidebar(array(
‘name’ => ‘sidebar2′,
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ”,
‘after_title’ => ”,
));
register_sidebar(array(
‘name’ => ‘sidebar3′,
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ”,
‘after_title’ => ”,
));
register_sidebar(array(
‘name’ => ‘sidebar4′,
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ”,
‘after_title’ => ”,
));
register_sidebar(array(
‘name’ => ‘sidebar5′,
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ”,
‘after_title’ => ”,
));
}?>
How can we make diffrent inputs according to the meta? Like on one tag i want a text fiend, on another i want a textarea and so on.
[...] Creating Custom Write Panels in WordPress [...]
Thanks for sharing this code with us!
[...] 6. Custom Write Panels using Functions.php [...]
Thanks for this, it’s great to know how these are created without the use of a plugin. It may take more time up front but I think it’s important to understand how these write panels are created and how their information is saved in the database. I think that understanding the way something is built will help you solve problems in the future faster, and more efficiently. I recently featured this article in my latest blog post, 6 Ways To Create Custom Write Panels in WordPress.
[...] Check the tutorial out. [...]
[...] by admin on October 20, 2008 Wow, thanks for the great tip. It is nice to see expert level WordPress tips once in a while. I will definitely be adding a link to this page on my own blog , and I can’ t wait to try using Custom Write Panels in my own blogs . …… Custom Fields Hacks For WordPress « N3T.ir – Web Resources, Web Design News & Tips , Open Source said: Creating Custom Write Panels in WordPressA very detailed tutorial on creating custom write panels in WordPress using custom fields. [. ... Original post: Function Web Design & Development [ Blog ] » Tutorial: Creating … [...]
[...] blog WeFunction ??????????????????“write page” - create extra write panels [...]
[...] Adding Forums to Your WordPress Site How to Set Up a Side Blog How to Create a WordPress Form Overlay Adding Goggle Search to Your Blog Converting the Author Display to Link to The Author How to Add Bio Info to Posts How to Insert an Ad Only After the 1st Post How To: Using Conditional Tags How to Add Social Bookmarking Links to Your Theme How to Separate Comments an Trackbacks How to Hide Individual Pages From Navigation How to Add Gravatars to Your Theme How to Use Thumbnails Generated by WordPress in Your Theme How to: Hack WordPress Theme Template Pages Get Recent Posts From a Specific Category How to Highlight Author Comments Show Related Posts Without Plugins How to Display Your Facebook Status Finding a Lost WordPress Password How to Display Your Latest Twitter Entry Multiple WordPress Loops How to Get Custom Fields Outside the Loop Display Your Tags in a Drop Down Menu How to Embed CSS in Your Posts With Custom Fields Creating Custom Write Panels in WordPress [...]
Look in your custom codes panels after you’ve used the created custom panel info.
Check the value in there and see what it says, thats the code you need to put in the loop.
Note: The code above appends ‘_value’ to any info you set.
Hi, maybe this question is already asked, but I couldn’t find it ; Is it possible to make 2 different boxes for the customfields, e.g. 1 for the blog posts and one for the portfolio posts.
nice tutorial for all bloggers
[...] Function Web Design & Development Blog – » Tutorial: Creating Custom Write Panels in… [...]
HI, This is excellent but I do have one question: How do I make this work as a textarea instead of a textfield?
Thanks!
This looks really, really useful, will be trying this soon, thanks!
Hi! I think its need some extra parameters,any way nice implementation.Thanks for the innovative one.keep post cont…………….:)
[...] tutorial que promete: Creating Custom Write Panels in WordPress. Con él el estudio Artisan Themes han creado el tema WP Contact Manager, que convierte un [...]
[...] ???Google Syntax Highlighter for WordPress? ???????/coder ?????????????????????JavaScript?????????????????????????WordPress??????????wefunction.com ??????????????????????????? Plain Text ?????????????????????? [...]
[...] Plugin From ScratchMastering Your WordPress Theme Hacks and TechniquesWordPress Theme HacksCreating Custom Write Panels in WordPress10 incredibly cool WordPress shortcodesAn Introduction to WordPress Action HooksBuild A WordPress [...]
Really useful tutorial. Got another one like this also. But it seems that this one is much more easier to follow. Anyway, i am looking how to custom write functions inside the admin panels. Still, this is great post!
Very useful for bloggers! Nice Post!
[...] blog WeFunction ??????????????????“write page” - create extra write panels [...]
Great stuff, i may try to upgrade my theme later this week since it is using thumbs just to try this out
telefon dinleme
[...] Tutorial: Creating Custom Write Panels in WordPress – A tutorial for adding unique data to your posts using custom write fields in the backend. [...]
Its nice, but gives blank pages in wordpress 2.8 , anyone know why?
[...] to enter post specific information as per this tutorial: http://wefunction.com/2008/10/tutori…-in-wordpress/. I have a challenge with javascript code that is entered in a field. I can add javascript code to [...]
[...] ???? ????? ??? ??????? ???? ?????? [...]
[...] blog WeFunction shows us how to create extra write panels for adding extra bits to the “Write” page of the admin [...]
thanks for the great tip. It is nice to see expert level WordPress tips once in a while. I will definitely be adding a link to this page on my own blog, and I can’t wait to try using Custom Write Panels in my own blogs. K
Why are there no timestamps on any comments?
[...] Creating Custom Write Panels in WordPress A very detailed tutorial on creating custom write panels in WordPress using custom fields. [...]
[...] great plugin system, and easy to use administration system, WordPress takes the cake. Using a Custom Write Panel, Custom Options, and manipulating the theme files, the possibilities are almost endless. In This [...]
[...] Creating Custom Write Panels in WordPress [...]
Great tutorial, thanks!! We’ve got it all up and running and now we’re wondering if it’s possible to do validation on these fields. For example, if we want one of the fields to be a URL and want the post to not save (or at least spit out an error message on save) if the user enters an invalid URL.
Any suggestions? The codex documentation for the save_post hook says:
“Runs after the data is saved to the database”
Which seems to imply that it’s too late for validation at this point. Should we use a different hook? Is it possible to have a hook-called function return 0 or something to create an error?
THANKS!
Instead of save_post, you could use the filter content_save_pre. The function that is called will have the post content passed to it instead of the post id. Example:
add_filter('content_save_pre', 'mySaveFunction'); function mySaveFunction($postContent) { // Do content modification or input validation here return $postContent; }It is important that you return the post content, else nothing will save! I suppose you can then append the error message to the post content, or have your write panel display the error message.
bob: Thanks for the lead!
It seems like the right idea, but the filter ‘content_save_pre’, only affects the content field. Any ideas on how I would get the fields that I just created?
In the content_save_pre function, just access the input fields using $_POST with the names of your fields.
[...] Custom Write Panels http://wefunction.com/2008/10/tutorial-creating-custom-write-panels-in-wordpress/ Tweet This!Share this on TechnoratiSubmit this to NetvibesAdd this to Mister WongMark this on [...]
???????? ????, ???????!
[...] explaining the nuances of add_meta_box in WordPress, and how it can be used to create some nifty Custom Write Panels. It was a nice little script, and still functioned great. I use it on almost all of the projects [...]
[...] ???Google Syntax Highlighter for WordPress? ???????/coder ?????????????????????JavaScript?????????????????????????WordPress??????????wefunction.com ??????????????????????????? Plain Text ?????????????????????? [...]
thanks for a great tutorial it has been very helpful i have one quick question about setting it for a particular category. ive used the code to set it for a category as above but the problem i have is that if you choose to add a new post then the category is not set yet so the panel does not show. is there a way to show it for a post that has not yet been set as well as only for a certain category?
thanks
[...] blog WeFunction shows us how to create extra write panels for adding extra bits to the “Write” page of the admin [...]
Thanks for the informative article
[...] usi simili a quelli relativi alle schede dei libri già illustrate. Inoltre è possibile creare dei pannelli customizzati che ci facilitino il [...]
[...] great plugin system, and easy to use administration system, WordPress takes the cake. Using a Custom Write Panel, Custom Options, and manipulating the theme files, the possibilities are almost endless. In This [...]
[...] explaining the nuances of add_meta_box in WordPress, and how it can be used to create some nifty Custom Write Panels. It was a nice little script, and still functioned great. I use it on almost all of the projects [...]
[...] Tutorial: Creating Custom Write Panels in WordPress – A tutorial for adding unique data to your posts using custom write fields in the backend. [...]
Thanks for the informative article
Nice Post!
nice, just what I was looking for.
Nice article, i read entries blog afternoon then add it to my bookmarks and wait for your next article, i plan to follow as you.
Thanks so much
decha kunla
Hi! I think its need some extra parameters,any way nice implementation.Thanks for the innovative one.keep post cont
thanks for a great tutorial it has been very helpful i have one quick question about setting it for a particular category. ive used the code to set it for a category as above but the problem i have is that if you choose to add a new post then the category is not set yet so the panel does not show. is there a way to show it for a post that has not yet been set as well as only for a certain category?
thanks
[...] Creating Custom Write Panels in WordPress [...]
I created a plugin based on this tutorial but my problem is that $post_id passed to my save function keeps incrementing (based on the revision and not the main post). Any idea why?
[...] October of last year, Spencer wrote a tutorial explaining how to create custom write panels in WordPress. The script worked great for various projects, but after foreseeing some problems, he [...]
Wonderful Tut. I have it working now and added three custom fields. Thanks so much!
Here’s my separate file that I include in my functions.php file.
http://pastie.org/693753
This is fantastic and really takes WordPress as a CMS to the next level. One question I do have is… Can this be used for pages as well as posts?
Did you mean that it can be used in “Edit Page” pages as well as “Edit Post” pages? If so, then there’s an easy way to enable both features. In this code:
add_meta_box( ‘new-meta-boxes’, ‘Custom Post Settings’, ‘new_meta_boxes’, ‘post’, ‘normal’, ‘high’ );
Just change ‘post’ to ‘page’ and this can be used for pages.
[...] being said, you can use this awesome function that makes using custom fields even nicer. It just makes them “prettier” and integrates [...]
Wonderful Tut. I have it working now and added three custom fields. Thanks so much!
[...] blog WeFunction ??????????????????“write page” - create extra write panels [...]
Perfect program, it tells very clearly.i will come here every day with my friends.
[...] theme makes extensive use of thumbnails, so I coded in a custom write panel to insert thumbnails into your posts as an alternative to custom [...]
[...] theme makes extensive use of thumbnails, so I coded in a custom write panel to insert thumbnails into your posts as an alternative to custom [...]
[...] WordPress has a solution for us. Liam is using a little something called add_meta_box. This is a detailed and quite useful tutorial on [...]
I’ve noticed that your plain text version has an encoding problem – the $post->ID here:
…other than that, fantastic tutorial – thank you!
[...] 2. Creating Custom Write Panels in WordPress [...]
[...] 2. Creating Custom Write Panels in WordPress [...]
[...] Tutorial: Creating Custom Write Panels in WordPress – A tutorial for adding unique data to your posts using custom write fields in the backend. [...]
Hi Spencer, great tut there, exactly what i just need. However, like Chris and others, i’d need multiple fields.
I tried the technique you pasted:
$new_meta_boxes =
array(
“image” => array(
“name” => “image”,
“std” => “”,
“title” => “Image”,
“description” => “Using the “Add an Image” button, upload an image and paste the URL here.”),
“image” => array(
“name” => “subtitle”,
“std” => “Standard Post Subtitle.”,
“title” => “Subtitle”,
“description” => “Add a subtitle to the post..”)
);
But it keeps showing just one field, the last one.
Has someone managed to create and save various fields ?
Edit, i made it, just pasted another one and works. Awesome, i’ll now get deeper into this to get what i need. Huge thanks dude!
You could have just made the $new_meta_boxes array into a multidimensional array with the top-level elements being individual meta boxes, and all meta box information stored in the sub-arrays. For example:
$new_meta_boxes = array(
’0′ => array(
‘images’ => array(
…
)
),
’1′ => array(
‘images’ => array(
…
)
));
Then you would have to modify the new_meta_boxes function like so:
Instead of
function new_meta_boxes() {
global $post, $new_meta_boxes;
foreach($new_meta_boxes as $meta_box) {
}
Do
function new_meta_boxes() {
global $post, $new_meta_boxes;
foreach ($new_meta_boxes as $new_meta_box) {
foreach ($new_meta_box as $meta_box) {
}
}
[...] 5. Creating Custom Write Panels in WordPress [...]
?????????? ????, ???????
Thanks for the article. The blog was very helpful.
I’m having trouble getting my custom meta item to show up in the text area where it was saved after updating the page. (However, it does save as custom post meta and shows up in the custom fields area.)
Any ideas would be great. Posted the code in the WordPress forums: http://bit.ly/8b2oRA
My meta is not showing special characters while listed in google search results. I’m using utf-8 and have excange special characters with utf signs but no luck.
[...] blog WeFunction shows us how to create extra write panels for adding extra bits to the “Write” page of the admin [...]
Cool site mate!
Thanks for the great site.
Thank you site good nice post much.
[...] ???Google Syntax Highlighter for WordPress? ???????/coder ?????????????????????JavaScript?????????????????????????WordPress??????????wefunction.com ??????????????????????????? Plain Text ?????????????????????? [...]
I like your website, I will share this with friends
[...] blog WeFunction shows us how to create extra write panels for adding extra bits to the “Write” page of the admin [...]
thank you for sharing.
Great! Glad everything seems to working, and you enjoyed the tutorial.
Great tutorial, thanks a lot
Thank you for this tutorial, comes in handy.
Thanks!! I always assumed this could only be done by editing the main WP files..
great tut! gonna try this out on a current project
Article that was on extremely good. I am very helpful. thanks for the information. good luck always accompany you.
It agree with the last statement.
I support last ??????????.
Interestingly here for you.
Thanks for the totourial,great one
very good article,if you are interested in my site,come.
A friend of mine was talking about your blog, so I came to check it out. After reading a couple of your posts, I must say that it’s quite good.
[...] Tutorial: Creating Custom Write Panels in WordPress (???????????????) – ???????????????????????? [...]
It’s been really hard to find good tutorials on creating meta boxes. Most people seem to be regurgitating eachother’s code. As far as clarity, yours is by far the best. You describe everything very well! Thanks a lot for the post.
[...] but we are control freaks and like to do thinks ourselves. So, as a starting point, we use this fantastic tutorial on Wefunction, but with a few [...]
came across this great list – thanks so much for sharing!
thank you everybody .This very important blog
After reading a couple of your posts, I must say that it’s quite good.
[...] ?????????????????????javascript?????????wefunction.com ??????????????????????????? Plain Text [...]
Learning!
I’ve been looking for this tutorial for so long.
Thank you for your time to post this.
Absolutely amazing tutorial! I spent nearly a WEEK trying to master Pods (a nice idea but not easy to understand), the very very buggy Flutter (which seems to be abandoned) and somehow came across this article. In about 3 hours, I had solved all of my custom field problems (and I am an “older” geek Mom). Spencer, you deserve a MEDAL for your patience, quick responses and lovely disposition! I’ve created a new write panel to add film meta to a film listing, with dropdowns and text entry fields. Everything works beautifully so far! THANKS THANKS THANKS.
[...] great plugin system, and easy to use administration system, WordPress takes the cake. Using a Custom Write Panel, Custom Options, and manipulating the theme files, the possibilities are almost endless. In This [...]
[...] explaining the nuances of add_meta_box in WordPress, and how it can be used to create some nifty Custom Write Panels. It was a nice little script, and still functioned great. I use it on almost all of the projects [...]
[...] great plugin system, and easy to use administration system, WordPress takes the cake. Using a Custom Write Panel, Custom Options, and manipulating the theme files, the possibilities are almost endless. In This [...]
[...] blog WeFunction shows us how to create extra write panels for adding extra bits to the “Write” page of the admin [...]
This is EXACTLY the information I have been looking for! Thank you thank you thank you!!
I knew this could be done, so glad I found this post. Thanks pal.
[...] might be harder to follow but the author provides the code to copy and paste and try for yourself. Check it out and the Latest revisited [...]
very helpful for me.
[...] Pipes101. Publishing External RSS Headlines to Your WordPress SiteBackend Related Tutorials102. Creating Custom Write Panels in WordPress103. Customize your WordPress Login104. Create a Tabbed Featured Post Area in WordPress105. Moving [...]
Absolutely amazing tutorial
Thanks a lot for the wonderful information
Great resources. Thanks
Dear Mr/madam
First of all thanks of lot for your valuable Time.
we are Manufacturers & Traders of Home combo UPS, ONLINE UPS, Battery, High capacity Inverter, FCBC charger and Servo-Voltage stabilizers.
Business offer – for sale purpose if you think for business::
we also made for you INVERTER, UPS on your name,brand if you require.
RENT Facility for You – if you not want purchase : :
Our higher capacity ONLINE UPS available on RENT
for any type of requirement you just call us::989188242 or mail:urdemond@gamil.com, with your complete detail like contact & requirement send us.
Thanks & regards
Ram kUmar Gupta
PowerONDemond Technology
http://www.urdemond .weebly .com
Dear Sir/Madam
We have obtained your name and address from power electronics site. We would like to take this opportunity to write to you in the hope of establishing business cooperation if possible
Our company has been specializing in manufacturing and exporting Electrical products (ON LINE UPS & Inverter) for many years. Also we enjoy a good reputation in this field. In order let you have a gentle idea about our products including UPS (uninterruptible power supply), inverter, battery and solar products,, our Power System Inverter tie the Wind Generators directly to the utility Grid and Solar Power Inverter match the Solar Generators System, Digital Power Inverter has USB output is special for Lighting, computer, for application in Electronics and Telecommunication, now we will introduce our goods to you in details:
1. High frequency online UPS
2. Line interactive UPS & Offline UPS for Computers
3. Home UPS/ Power Inverter DC/AC for Home
4. Lead-acid battery/ UPS battery
5. New Products: Solar chargers, Solar panels and solar power plants
If any of the items listed meets your interest, please inform us of your specific requirements. You may be assured that all of your requirements will receive our prompt and careful attention.
If you are interested in Pure Sine Wave Inverter and would like to get more information, please let us know. We are pleased to sent you our catalogue and price list which details of our products covering different sizes available
We are appreciating it you if you will pay attention on our products and welcome your inquiry, we look forward to receiving your reply and hope your pleasure
For more information you can come or call now: 9891882432
Welcome to visit our website http://www.urdemond.weebly.com for more details.
Thank you very much for your time
Sincerely yours
PowerONDemond
[...] ???Google Syntax Highlighter for WordPress? ???????/coder ?????????????????????javascript?????????????????????????WordPress??????????wefunction.com ??????????????????????????? Plain Text ?????????????????????? [...]
[...] WordPress has a solution for us. Liam is using a little something called add_meta_box. This is a detailed and quite useful tutorial on [...]
Would this work if added to the Category Description editor page?
Awesome tip, this will come in so handy.
Great Tutor, thanks for sharing
Very Helpfull. Thanks
[...] Tutorial: Creating Custom Write Panels in WordPress – A tutorial for adding unique data to your posts using custom write fields in the backend. [...]
[...] blog WeFunction ??????????????????“write page” - create extra write panels . 34. WordPress as a CMSWordpress???????????????????cms, it [...]
This might interest those looking for custom fields on category pages:
http://www.iamseo.org/wordpress/custom-fields-for-categories-wordpress/
[...] Tutorial: Creating Custom Write Panels in WordPress (???????????????) – ???????????????????????? [...]
Awesome tutorial. Thanks a lot for this. I have a question about adding additional write panels. I added another array like you mentioned in one of your comments above and everything is working fine. My question has to do with displaying the write panels. I want my first panel to only show on the “pages” page and the second panel to only show on the “posts” page. Can this be done? Thanks a lot.
??, ?? ?????? ??? ????? ????? ??????? ??????????? ? ?????????.
??????? ? ???????? ?????, ???????? ?? ??? ?????.
This is awesome! I just started getting into wordpress and php so im having some issues.
I got my custom fields to show up when creating a new post, but I cant get the info to display in the post.
I need to put this into my single.php file right?:
if my new meta boxes function has
$new_meta_boxes = array( "address" => array( "name" => "address", "std" => "", "title" => "Address", "description" => "Type the <strong>address</strong> of the apartment"),This is awesome! I just started getting into wordpress and php so im having some issues.
I got my custom fields to show up when creating a new post, but I cant get the info to display in the post.
I need to put this into my single.php file right?:
if my new meta boxes function has
$new_meta_boxes = array( "address" => array( "name" => "address", "std" => "", "title" => "Address", "description" => "Type the <strong>address</strong> of the apartment"),This is awesome! I just started getting into wordpress and php so im having some issues.
I got my custom fields to show up when creating a new post, but I cant get the info to display in the post.
I need to put this into my single.php file right?:
ID, “address_value”, $single = true) != “”) :
?>
<img src=”ID, “address_value”, $single = true); ?>” alt=”" />
if my new meta boxes function has:
$new_meta_boxes =
array(
“address” => array(
“name” => “address”,
“std” => “”,
“title” => “Address”,
“description” => “Type the address of the apartment”),
Hi, I really new to PHP and I am building a blog that also has a lot of pages that will be managed by designers who will create pages with their work anytime they want. Reading this tutorial you have here, which is amazing by the way, I get the idea this might be exactely what I need. My problem is that being a newbie in PHP and not understanding enough about it, I am not sure this will do the trick I need.
The problem is that all the designer know nothing about word press, and the backend is really confusing for them. So this is really help qieh the custom meta I have in the pages. But there is another thing that I haven’t figured out yet.
I have about 5 different templates for pages, but I only want them to use 2 of these templates.
Is there a way to hide the other templates (the templates I don’t want them to use) from showing up in the list, for anyone except the admin? And Is tere a way to have a thumbnail show for each of the templates, so they can’t see what they look like?
If you have any pointers you can give me about these questions I would appreciate it.
Thanks so much in advance.
thank you everythinks..Thank you for all the valuable information
Great tutorial, i was looking for something like this to incorporate in my new wordpress theme.
[...] 19. Creating Custom Write Panels in WordPress [...]
Thank you very much !!!!
This is well written and clear. I also appreciate that you have the entire code grouped together after the explanation.
Thank you!
[...] Function Web Design & Development Blog – » Tutorial: Creating Custom Write Panels in… Quick tutorial in add_meta_box – the way to add custom fields to WordPress forms. (tags: wordpress addmetabox development plugin ) [...]
[...] 102. Creating Custom Write Panels in WordPress [...]
I was doing the tasks but now I’ve come to a problem. The theme I am using already uses these custom panels. I enter all the code and it shows up in my admin panel, now the problem is its not saving or showing what I enter in those fields. For some reason I cannot add the function save page data. Whenever I add it to my custom write panel my page goes blank. If I remove the code it works but will not save the data. Any help would be great.
Thanks,
Dan
I took out the arrays to shorten code. The function I added was new_meta_boxes.
[...] explaining the nuances of add_meta_box in WordPress, and how it can be used to create some nifty Custom Write Panels. It was a nice little script, and still functioned great. I use it on almost all of the projects [...]
hey, thanks for this great tutorial. That’s waht I needed.
But there is still one question:
is there a possibilty to offer this custom field only when I’m using a special template?
I want to use ist only in some templates, not in all my templates.
Thank’s!
Andreas
ok, i got it now:
foreach($new_meta_boxes as $meta_box) {
if( $post->page_template == “THE_FILENAME_OF_MY_TEMPLATE.php” ) {
// Normal Stuff
} else {
echo’No Options for this Page’;
}
}
Hi,
This is really amazing, but I was wondering, if it is possible to create a Custom post type with the fields we wnat and leave the regular post as is, so we can have both alternatives.
I know wordpress 3 already has this, but I would like to know if this can be done already by code, and is supported by wordpress 2.9.2
And thanks again for this wonderfull tutorial.
Setup
U?ak Haber
[...] ????????????????????“add_meta_box()“??? [...]
[...] in php coding and WordPress—you just want to understand the code—I recommend a different tutorial and update (to the same tutorial) by Spencer at Function. You can also find code below, but this [...]
[...] ???Google Syntax Highlighter for WordPress? ???????/coder ?????????????????????javascript?????????????????????????WordPress??????????wefunction.com ??????????????????????????? Plain Text ?????????????????????? [...]
[...] ???Google Syntax Highlighter for WordPress? ???????/coder ?????????????????????javascript?????????????????????????WordPress??????????wefunction.com ??????????????????????????? Plain Text ?????????????????????? [...]
Can this work with the new custom post aspect of WP3?
I’ve created a new post type and its only showing up in the default posts, not my new created one?
Thanks for this great tutorial. But as you said i will be happy if it was less complicated. Also please write one on how to expand this by using more custom fields. Like Image, Designer Name, Website url and more. http://www.wiki.mediamilan.com
[...] for displaying the meta information included about authors within the front-end of your WP site.Tutorial: Creating Custom Write Panels in WordPress – A tutorial for adding unique data to your posts using custom write fields in the [...]
Thanks a lot for this friend. Really appreciate u r work.
[...] la página web WeFunction he encontrado un sencillo tutorial que nos ayudará a programar un panel de control personalizado [...]
[...] Tutorial: Creating Custom Write Panels in WordPress – A tutorial for adding unique data to your posts using custom write fields in the backend. [...]
hi,This is beautiful blog.Good tips in this blog. I like this blog.
[...] Had a tough time getting custom meta boxes to work, but Spencer at wefunction.com broke it all down for me. [...]
Good information and good way your blog post. Good luck blogger man.
it’s too important thanks…
very nice info
[...] Creating Custom Write Panels in WordPress A very detailed tutorial on creating custom write panels in WordPress using custom fields. [...]
thank you for good tutorial
I have few blogs of my own , have not tried creating custom write panels , but with the help of this , I might write one
very good tutorial, but unfortunately I can not understand it too deep for about php … but I will try to learn from here
This is well written and clear. I also appreciate that you have the entire code grouped together after the explanation.
Thank you!
very good tutorial
This is well written and clear
Thanks for this great tutorial.
[...] WordPress ????? ? (tags: wp ????? ??) Function Web Design & Development Blog – » Tutorial: Creating Custom Write Panels in Word… (tags: wp ????? ?????????) [WordPress] ?????????(2) [...]
[...] going to write a new post in a few days about the even newer way I create my meta boxes. It takes out all those nasty arrays, and just goes back to the basics. [...]
[...] is one of the topics I like to talk about. I’ve not only written about it once, but I followed that up about a year later. But, here I am again, with new thoughts on things, and [...]
[...] 102. Creating Custom Write Panels in WordPress [...]
its very good here
This is so amazing! You bascially just coded a menu that could compete with Woothemes! When I get a new wordpress theme, I will try to refer to this post, and hopefully, be able to build a custom admin panel for themes!
[...] Tutorial: Creating Custom Write Panels in WordPress [...]
Among all the blog websites wordpress is giving more user-friendly option to create.
Well, your article help me alot in coding a premium WordPress theme
, thank for it
[...] Tutorial: Creating Custom Write Panels in WordPress [...]
thanks admin
nice blog great document!!!
Medyum Niyazi
Hi @Spencer. I managed to implement this on my blog. I was reading some of the comments and stumbled upon to one of your comments that if ‘post’ is changed to ‘page’, the custom panel will switch on the Page entry. So, how would I go on adding both custom panel to ‘Post’ and ‘Page’?
Thanks.
[...] Tutorial: Creating Custom Write Panels in WordPress [...]
nice designs
[...] WordPress has a solution for us. Liam is using a little something calledadd_meta_box. This is a detailed and quite useful tutorial on [...]
I’m getting a parse error:
I’ve added the code to pastie, its line 10 thats causing it, any ideas?
thank you perfect design
wow perfect design thanks wefunction
Two Words:
Oh
Wow.
thanks for this… been looking for this information for a while now and have just implemented the code that @Chris provided at http://pastie.org/303398... works like a dream – even on 3.0
Legend… can’t thank you all enough.
[...] to get seriously into it, as it’ll bore the pants off most of you… but I found some GREAT code (and discussion) on how to edit Custom Fields in WordPress, allowing you to style up custom fields as combo boxes [...]
Thanks for shared, You bascially just coded a menu that could compete with Woothemes! This is so amazing and thanks again for this wonderfull tutorial.
I have few blogs of my own , have not tried creating custom write panels , but with the help of this , I might write one…..
Thank you so much for this tutorial, it’s awesome.
I have been able to create one checkbox so far and it’s working fine but I need to create multiple checkboxes. any help will be much appreciated. Thank you.
@Maryam – the code is all in there, you just need to add a new array element inside the new_meta_boxes array for each checkbox group. To add multiple checkboxes to a checkbox group, you basically just need to copy the way the original tut has done the drop down but swap out the syntax for select/option for the form checkbox syntax as per:
As a complete aside, if you’re looking for multiple custom field write panels, wouldn’t it be possible to wrap the new_meta_boxes and new_meta_boxes2 arrays into an outer array then loop through using foreach on the outer array? Then you wouldn’t have to duplicate the selector code as per my example above… Thoughts anyone?
http://pastie.org/1056485
Thank you BrenFM
Okay I have a few checkboxes not but the problem is that every time I select one and save, they both come back as checked.
This is the code I am using:
if($meta_box['type'] == ‘checkbox’) {
if($meta_box_value == ‘yes’ ) $checked = ‘checked=”checked”‘;
$input_type = ”;
}
I have tried giving them a different value but that has not worked either.
Thanks for the tut. Now I can create custom write panels with ease. WordPresss rocks!
[...] Tutorial: Creating Custom Write Panels in WordPress – A tutorial for adding unique data to your posts using custom write fields in the backend. [...]
thanks admin
Thanks for sharing this tutorial. I am running WP 3.0 Multi-Sites. If I choose to use this approach, would it affect all the sites? Or can i choose to use the plugin for one site and the rest of the sites would be able to see the default write panel? Please advise.
was an article I liked. Thanks for sharing.
…
I’ve added the code to pastie, its line 10 thats causing it, any ideas
thank you for the information,
This was helped,
spirit! ! ! ! !
realy helpful informations. i use wordpress very oftem. thank youu.
wordpress is most popular blog cms, so thank you for this informations
SEO UK Get Free consultation from SEO Expert, SEO Consultant Bidyut Bikash Dhar who also offers Link Building Consulting Services in London, UK. If you are searching keywords like SEO consultant UK, SEO expert UK, Link building UK, Local SEO UK, UK SEO, SEO UK, London SEO, SEO London, SEO company London, SEO consultant London, SEO agency London, web London, UK consultant, UK SEO consultant, SEO services London, SEO services UK, SEO Consulting then call us now at +44.2032866561.
Staffing agency can be a lead source for good number of executive jobs. And finding a company that can successfully places people with your kind of skills will be key to success. Basically what kind of position they fill or what types of openings they have can give one an idea of whether it’s worth your time to apply.
Pay Per Click Advertising (PPC) services is one of online marketing services that drives targeted leads to your websites from search engines like Google. Our PPC (pay per click management), CPC expert consultant will ensure best ROI for your business. Call us now for pay per click marketing, pay per click (PPC) advertising, PPC (pay per click) search engine marketing and PPC search marketing services.
Thanks for sharing.Good web site
[...] WordPress has a solution for us. Liam is using a little something calledadd_meta_box. This is a detailed and quite useful tutorial on [...]
Wow………nice article. Thanks fro sharing.
Just what I need to customize my wordpress admin. Thanks a lot for this tutorial.
Great Tut, very useful
Just what I need to customize my wordpress admin. Thanks a lot for this tutorial.
Very easy to follow, great share
seems a little complicated. although the solution is not so perfect, but enough for now. thanks for posting.
very good tutorial, but unfortunately my brain is not able to think to far
thanks you share good your article
Thanks for sharing the code to get some great looking custom write panels
Very useful tutorial. Thank you! I will try to implement techniques into my themes. LT
[...] blog WeFunction shows us how to create extra write panels for adding extra bits to the “Write” page of the admin [...]
Thank you for a great tutorial! This is exactly the information I needed! I am having a bit of trouble getting it implemented though… Started off with several syntax errors, which I think have been fixed. I no longer receive any errors, but the meta boxes do not show up in the add new post page. Can someone please take a look at my code and get me straightened out? Here is the pastebin: http://wordpress.pastebin.com/tvMTS1qd
I actually got the problem worked out… seems as though you can’t call add_action inside the function… /me facepalms Anyway… thanks again for a great tutorial!
http://wordpress.pastebin.com/pGywtkYB
Wonderful.I like that you have describe all coding line just simple way.It help to many developers..
so useful tutorial. thank u so much.
Thank you for a great tutorial! This is exactly the information I needed.
I started blogging now.
This website is really helpful and informative.
Thanks a ton.
A+ grade for this post form my side.
Thanks for sharing the code. Very useful tutorial. I like and thank you
Very useful tutorial. Thank you! I will try to implement techniques into my themes.
I just got a wordpress blog and this helped me out a lot on getting it setup properly. Thanks for the post!
Awesome! Everything is working perfect. Thanks again for all the help!!
Thanks for the excellent tutorial… I wish more people would write about advanced topics such as this!
This is exactly what i was looking for, thanks so much guys.
Good work..
A+ grade form my side.
I am new to wordpress..
Your blog helped in understanding wordpress..
Thanks
Jitendra
Fantastic and very useful tutorial, will try to implement some of the techniques, Thanks!
Here are two sites I’m using right now to build my own solar panels. It’s not my first time going solar (built a small panel this weekend), but it’s the first time I’m building something large enough to take over part of the electrical needs of my home. Hopefully one day, I’ll be 100% off grid!
GREAT tutorial. I am using it in several sites now. However, is there a way to use it to create a custom field to embed a YouTube video? I saw JackAttack asked about it, but i never saw a definitive answer, and I just don’t know where to start.
Wao great Fantastic and very useful tutorial, will try to implement some of the techniques, Thanks!
[...] sem o uso de plugins, mas o resultado é muito satisfatório.Foi baseado no excelente trabalho do Spencer!Clique aqui para baixar.DownloadRelated posts:5 plugins que não podem faltar no seu blogPlugin [...]
Really Great tutorial!
woww..Thank you very much for this information.
Good post thanks for sharing.
I like this site
I have few blogs of my own , have not tried creating custom write panels , but with the help of this….
Amazing Post on wordpress..
i am new and this is Cool Tutorial for me.
Thanks a ton.
Thank you Mark bed !!
[...] Visit Article [...]
[...] blog WeFunction ??????????????????“write page” - create extra write panels [...]
Thanks for the tutorial! Really helped me!
[...] idea you could utilise is creating some custom write panels that will have these fields displayed already instead of creating them from scratch. It will be [...]
Timberland boots are again commonly referred to as “timberland chukka boots”, they are not that pretty but you can say that you’ll love them once you wear them Timberlands are perfect in both warm and cold climates, made of 100 percent sheepskin that will keep your feet dry and comfortable.
For those of you who that are followers of Supra and their Skytop form, we have a heal for you. Here we characteristic a two of Supra Trinity NS TUF’s, which characteristic a crackled cowhide construction. The footwear has a navy azure top that comprises of the exclusive material and the consequences are great. The white spots on the textured cowhide makes the white sole and agrees to stand out even more. They have made their way over to choose anecdotes encompassing NYC-based DQM.
Native American Moccasins are greatly highly appraised even today. The reputation of Native US Moccasins is astounding. Mens MBT Sports shoes US Indians are to some extent nomadic so they fashioned boots that have flexible but sturdy soles and are durable abundant to withstand the elements.
[...] blog WeFunction ??????????????????“write page” - create extra write panels [...]
I need a character count widget but found some interesting information on wordpress
Thanks.
I understand the concernsoI am very z glad to hear that you got your Supra fixed: I remember reading about some of your problems5xa !.
Really a great step by step tutorial
I have a suggestion which I have found no answer to so far after days of searching, which is how I found this article.
I am looking for the best way to create a custom write panel in wordpress-mu that can be turned into a ‘plugin’.
Here is what I have been trying to do:
I am creating an mu setup where different bands can come and signup for their own blog, easy enough mu is built for that.
Here’s where I get stuck.
When they create their new site, I want them to be able to activate their ‘custom write panel’ when adding a music album.
That way all the needed fields are already in place along with the templating system for it, whether using a custom pod, more fields, flutter, etc…
So far everything I have come across looks like it’s built for a ‘one off’ project. It’s like either I am missing something, or every one of these options is not designed to ‘export as a plugin’ that can be activated by the users new blog.
Make sense?
thanks u
I have few blogs of my own , have not tried creating custom write panels , but with the help of this….
very useful information to me.
thanks
Best you could edit the webpage name Tutorial: Creating Custom Write Panels in WordPress | Function Web Design & Development Blog – to something more specific for your webpage you make. I loved the blog post withal.
[...] blog WeFunction ??????????????????“write page” - create extra write panels [...]
Thanks for this tutorial. Very easy now.
[...] idea you could utilise is creating some custom write panels that will have these fields displayed already instead of creating them from scratch. It will be [...]
[...] Tutorial: Creating Custom Write Panels in WordPress ????: http://www.setlt.net/archives/743 | web??? [...]
I am happy to find this post very useful for me, as it contains lot of information I always prefer to read the quality content and this thing I found in you post. Thanks for sharing.@ugg shoes: really good. I want to download buddy!
bosch beyaz e?ya servisi
i could only wish that solar panels cost only several hundred dollars, i would love to fill my roof with solar panels ‘-,
garantili franke servisi mobil servis
This seems to be broken with WP3? Produces: Fatal error: Call to undefined function add_action() in …
[...] blog WeFunction ??????????????????“write page” – create extra write panels [...]
Article is very good and very useful, thank you!
Your article I like very much, very good.
Thanks for your sharing, pain, is very helpful to me.
nice article for good blog thanks.
thanks mese lamine parke
[...] 102. Creating Custom Write Panels in WordPress [...]
thanks for the post, off to try this now.
Lol sorry but sorted it out myself..
wondering if there is a way to enable the ‘add’ functionality that the default wp custom field has… any ideas ?
ie ” add new my_custom_field”
[...] ???Google Syntax Highlighter for WordPress? ???????/coder ?????????????????????javascript?????????????????????????WordPress??????????wefunction.com ??????????????????????????? Plain Text ?????????????????????? [...]
Thank you for sharing the tutorial …. It’s helpful … I’m having a problem with my wordpress blog …I’m trying to fix it , from last 3 days. It’s about custom panel setting… I think I found the answer. Just want to test it.
thanks for sharing nice post for wordpress write panel. This panel is wonderful.
[...] 102. Creating Custom Write Panels in WordPress [...]
I think I found the answer. Just want to test it.
Replica Watches
padrisimas las imagenes muchas gracias
guzel
I am a wp fans,it is really a cool Tutorial
I really don’t know how to create custom panel in wordpress. Well, it is so wonderful for me to saw this post and the tutorial is very clear..
Cremation Urn
I did do it
Offering free tools for blogs and Web sites – weather tools, news and Prayer
very useful, thank you! god
very useful, thank you!ff
ukashse
filmes good
of be yete aaars
Offering free tools for blogs and Web sites – weather tools, news and Prayer
when doing your PS mockups turn anti-aliasing off to make the text look more like web rendered typejhkjhkuyr
Offering free tools for blogs and Web sites – weather tools, news and Prayer tax .
Offering free tools for blogs and Web sites – weather tools, news and Prayer tax .bosssssssssssss
Beau travail.Tenez-vous au bon travail.
Offering free tools for blogs and Web sites – weather tools, news and Prayer tax .bossssssssssssss
the text look more like web rendered typeghgfhdrrtyts
This blog site has lots of very helpful info on it bhhe eese
anti-aliasing off to make the text look more like web rendered typenömbtrtrtfffvvvbb
For sure, there’s plenty more themes to come
I have added a blog to my site which is not a wordpress blog, i suppose its more of a microsite, and have been searching for info on wordpress. I found your atricle really
That is why it calls my attention to visit it again for more source of new informationu?ouyhknhhhf
Offering free tools for blogs and Web sites – weather tools, news and Prayer tax .bosssssssssssssssd
[...] Tutorial: Creating Custom Write Panels in WordPress.: A fantastic, detailed and quite useful tutorial on creating custom write panels for the WordPress Write Post page. I had written something similar for the WordPress Jobs site and it turned out to be a fantastic tool to quickly get to and add/modify Custom Fields in posts. Custom write panels are most useful for customized installations of WordPress and could be used to add many different types of information into a post both easily and quickly. The image below shows a couple of examples of custom panels and I am sure there are hundreds more. [...]
hat is why it calls my attention to visit it again for more source of new informationhfghfgölgh?ölçbnö
hat is why it calls my attention to visit it again for more source of new informationhfghfgdcvdczvzzvzvzz
because the Australian was worried that the ugg outlet boots was too much of quirky Australian design to make a hit in the US. ugg boot on sale Buck diamond
the ugg outlet boots was too much of quirky Australian design to make a hit in the US. ugg boot on sale Buck diamond
of a cute corpse with forks stuck in it.(for that neverending juxtaposition angle ZZZzzzz
hat is why it calls my attention to visit it again for more source of new informationgsswq
Offering free tools for blogs and Web sites – weather tools, news and Prayerhkopder nave my youou?
Offering free tools for blogs and Web sites – weather tools, news and Prayerhkopder nave my your.ifç.db .fd.v,sd.vi.dfigbç
Offering free tools for blogs and Web sites – weather tools, news and Prayer:D;sfgddf
Offering free tools for blogs and Web sites – weather tools, news and Prayer:ç?fl?lflff
Offering free tools for blogs and Web sites – weather tools, news and potypotypy
Offering free tools for blogs and Web sites – weather tools, news and
ldslkksdl
Sounds interesting that you give such idea.. Well thanks, its a great help…
kjjjjjjfg
Sounds interesting that you give such idea.. Well thanks, its a great help lkfldgklkdf
Sounds interesting that you give such idea.. Well thanks, its a great?poo??uuytr
Sounds interesting that you give such idea.. Well thanks, its a great ??ldcjjh
Offering free tools for blogs and Web sites – weather tools, news and Prayer tax .bossssssssssssssse.sq
[...] 102. Creating Custom Write Panels in WordPress [...]
Sounds interesting that you give such idea.. Well thanks, its a great :çökl?hklfk
Lozano consigue en África la Cruz del Mérito Militar por su actuación contra los moros. En 1923 es nombrado capitán y regresa a la Península, primero çölll
gooooooooooood
god download film
Is there an easy way just to ad upload button instead of instruction “how to copy&paste” image. As it is used by family site all guys ask the same question “where is image button”.
Thanks for excellent info so far, good content never expires
PS. Greetings from Pilates Hong Kong addict.
Since the offical Apple iphone 4 available, we can see people with white iphone 4 in their hands all around. Okay, i have to admire, i’m a little jealous.
in this autumn there’s already got white iphone 4 cdxfvdöç
Hey I man,
“save_postdata” function is called twice, why?
inside thate function
update_post_meta is also called every time, not only when data is updated, because $data variable is “” when it checks for it
$data != get_post_meta($post_id, $meta_box['name'].’_value’, true)
strange, I encountered this because I am downloading files from another server based on this extra meta boxes and I don’t want to redownload everything if data entered in boxes is not changed.
I hope it makes sense
We are extremely sad that you are not able to continue your fantastic magazine! But thanks for the inspiration.
really nice panels for wordpress. i used this so many times, thanks for the great advice.
This article very nice. Than you tutorial creating costum write panel. I use to wordpress.
I agree in what you said.. the tutorial is very awesome and so helpful..
Scented candles
This post is really nice
Excellent website.This is very informative..
Thanks for sharing knowledge !!
Your article is very informative and the use of graphics adds to understanding the process.
I think some of your sentences are too long, and a few minor commas are missing. One thing I was taught, never end a sentence with a preposition.
freeeeeeeeeeee weblogs
freeeeeeeeeee weblogs
Thanks for this post. Really great functions for wordpress.
Boots body plumage and boots lined with skin, or lining vinyl. Inner Mongolia five when called wide sleep inside the temple has preserved I living buddhas robson larson pair of cortical have boots, it has more than 200 years of history.
Thank you very much for the nice blog
Interesting thoughts here. I appreciate you taking the time to share them with us all. What a great website, I am happy I found it.
really helpful information. I also use WordPress and am very satisfied. Keep it up
really good and really useful post here.
amazing tutorial that is just great.
Thanks a gazillion! This is EXACTLY what I was looking for!
It is leaflet printing.. If you want to learn more just visit the site..
Conference Venues
[...] 102. Creating Custom Write Panels in WordPress [...]
Sincerely, your article goes to the nitty-gritty of the topic. Your pellucidity leaves me wanting to know more. kupujem prodajem I will instantly grab your feed to keep up to date with your website. Sounding Out thanks is simply my little way of saying bravo for a remarkable resource. Accept my warmest wishes for your incoming publication.
Having a custom write panel for a wordpress site makes it more beautiful..
I thought this article very good, If not this article. I do not know where to find information. Thank you very much. I will always follow your articles.
information. Thank you very much. I will always follow your best
information. Thank you very much. I will always follow your release web you nr my
information. Thank you very much. I will always follow your control by teac google web site
information. Thank you very much. I will always follow yourrows rate
Thank you very much for the nice blog
[...] blog WeFunction ??????????????????“write page” - create extra write panels [...]
[...] Basically the code I have produced will allow you to create a set of option fields under the post editor in WordPress which can accept data from the user, the code is adapted from Liam McKay’s tutorial here. [...]
Thanks for sharing this useful tutorial.
You may be able to deal with the maker of your wedding dress if you are also shopping for bridesmaid dress. Shop around, maybe have the bridesmaids appoint a representative to go with you. Come back with some ideas of costs.
If you want to know more, please go to Wedding Bridesmaid Blog.
THIS REALLY HELPED ME FOR MY BLOG.
I m new user and this was great information shared.
Fantastic post.
This really helped me alot.
Best Sayings
super e mail adress thank for this e post your blog.
it is a wonderfull blog this blog amazing. Thansk my friend for this.
it is a wonderfull blog this blog amazing. Thansk my friend for this is.
You may be able to deal with the maker of your wedding dress if you want to.
Having a custom write panel for a wordpress site makes it more beautiful this..
The problem I’m running into is the data is not saving in the meta box. If you enter the url initially it works fine, but if you were to update your post without re-entering your url within the write panel it loses the data. The data is not saving.
Any advice?
Thanks!
the text look more like web rendered typeghgfhdrrtyts
Thanks for the great help of yours. These tutorials are really very helpful for me.
Great post, been trying it for awhile now!
This will help you, as it solve my problems in filing taxes. free income tax preparation courses.You can also check out this website for all your tax needs. Do you want to become a tax preparer? You can also avail of free software on tax and video on how to become one. Patriot Tax Solutions Inc.
thanks
very god
Nice post. My friend John told me about this blog some weeks ago but this is the first time I’m coming. I’ll undoubtedly be back.
Guys, just want to say thanks for this wonderful resource of information. Its proved to be very useful to me!
The problem I’m running into is the data is not saving in the meta box. If you enter the url initially it works fine, but if you were to update your post without re-entering your url within the write panel it loses the data. The data is not saving.
Any advice?
Thanks!
Wow, thanks for the great tip. It is nice to see expert level WordPress tips once in a while. I will definitely be adding a link to this page on my own blog, and I can’t wait to try using Custom Write Panels in my own blogs. Keep up the good work.
Thanks for the great help of yours. These tutorials are really very helpful for me.
This Tutorial Really useful for My Projects. I have been looking for easy tutorial about creating custom write panels in wordpress for a while until i found this post. Thank you very much
[...] Tutorial: Creating Custom Write Panels in WordPress (???????????????) – ???????????????????????? [...]
The problem I’m running into is the data is not saving in the meta box. If you enter the url initially it works fine, but if you were to update your post without re-entering your url within the write panel it loses the data. The data is not saving.
Any advice?
Thanks!
Quite interesting code. I appreciate the one. One question question that if in the creation of fields we require a 3D array, what changes we would make.
You have a fantastic site with lots of useful information in it. I will certainly urge this site to my friends as well. Keep with your fantabulous work.
Really thanks
Creating Custom Panels in WordPress is hard, but very useful in long run, great article
Marios
Dubai shopping mall is a most catchy word for buyers who come from all over the world in search of quality products and other consumer items. Dubai shopping mall is an ideal place.
nice post thanks for shearing this kind of post
Very Me See Good you
Wonderful! Techniques are interesting and the final result is awesome. I have learned a lot
[...] blog WeFunction ??????????????????“write page” - create extra write panels [...]
nice post thanks for shearing this kind of post
I appreciate Your topic because it is very interesting for me.it provides a great infos so I’ bookmarked it.thanks for sharing this topic
[...] blog WeFunction ??????????????????“write page” - create extra write panels [...]
See Very Me Good
Yes this seems, but I must be missing something. Where do each of your code segments go on my site. Please contact me. What I would like to do is add 2 text boxes and below where my admin users are other allowed users to post to the blog.
They would be article publication and article author from when we post articles from say popular science magazine or others. For instance publication would be popular science and then the author that authored it at popular science. When there is an original article by one of my users or myself they could leave the text boxes empty and nothing would be displayed. I would like to display this information at the end of each post.
lie to say that when I delete everything silemedim.unutup separation bilemedim.yaz?lm?? destiny love google very nice comments in this business try to understand, love is no longer indispensable gibisin.sanane
i want to fix that problem. i will try this. i think that would be great
Dubai shopping mall is a most catchy word for buyers who come from all over the world in search of quality products and other consumer items. Dubai shopping mall is an ideal place.
Hope this Thread is still open as ist gains more spam over time
First i want to thank you for this great tutorial. Tested it right now and it works fine.
I still get error essages in the admin panel although saving and displaying in the frontend template works wonderful.
Errors are like this
Notice: Undefined index: date_noncename in /var/www/vhosts/bb-ovp.de/httpdocs/wp/wp-content/themes/testtheme/functions.php on line 73
Warning: Cannot modify header information – headers already sent by (output started at /var/www/vhosts/bb-ovp.de/httpdocs/wp/wp-content/themes/testtheme/functions.php:73) in /var/www/vhosts/bb-ovp.de/httpdocs/wp/wp-includes/classes.php on line 1601
In “date_noncename” on first line is “date” the name of the metabox i insert.
The errormessages appears after 1 min or so after admin panel has self-refreshed (some kind of auto function i did not touch so far). If i refresh the site myself the error message does not show up. After a few seconds (maybe 20) the error message shows up again.
I read all the comments and did not find this subject . Wonderin if im dumb..
I followed the tutorial and after errors tried all kinds of copy and paste but the error sticks.
If you still spend time on writing comments to this tutorial (didnt see any dates here) it would be awesome you could give me a hint. thanks in advance.
Thank-you for this great blog
Glad you all dig! Was a fun little piece to roll out for such a fantastic design and development resource!
oops that’s not spam
just saw the questions marks^^sorry for that
Thanks for this great tutorial! I didn’t know you could add new panels for your custom fields. Will try it out!
And the problem is solved.. it was the “isset” issue as mentioned earlier in this thread ..
just in case anybody else has this problem
the error
(php) Notice: Undefined index ‘fields of the table’ in ‘path of php file being executes’ on line ‘current line’
the solution
To avoid this error , simply test whether the fields of the table was initialized with the function isset ().
alternative solution and trigger for the php error message
level down the error reporting status of php (in php.ini)
if you don’t have access to php.ini only usage of isset can solve the problem
(as it did it in my case)
thanx again for your great tut work so many desperate webheads benefit from ^^
I just love designing. By the way, nice post.
perhaps this was not the good idea, in fact, I don’t really like Tommy Grebbish all that much.
And the only other suitable feetwear are the fugly moon-boots you brought with you from Wisconsin
Very nice thanks bro
perhaps this was not the good idea, in fact, I don’t really like Tommy Grebbish all that much.
WP writing panels really hating. i wanna the older. thanks
can I share that article on my website
thank you,very nice website
He said your name. You signed the receipt
Nice Tutorials, Thanks for useful sharing.
Thank you for another essential article. Where else could anyone get that kind of information in such a complete way of writing? I have a presentation incoming week, and I am on the lookout for such information.I was very encouraged to find this site. I wanted to thank you for this special read. I definitely savored every little bit of it and I have you bookmarked to check out new stuff you post.
WP writing panels really hating. i wanna the older. thanks
I really appreciate your tutorial for using in my blog now
http://yayausman.blogspot.com/2011/02/komodo-island-is-new-7-wonders-of-world.html
[...] Tutorial: Creating Custom Write Panels in WordPress (???????????????) – ???????????????????????? [...]
cheap gucci bags online sale
I really like your topic and appreciate your work.it is so interesting for me because it provides nice infos so I’ bookmarked it.thank you for sharing this topic
birth feeders are a great accessory for bird houses, and really adds to your collection
Feature will keep you satiated throughout the day food takvitesi Iceland Moss
allows you to eat junk food and only what you need
keep away from you. So balance your appetite, lose weight more easily
provides.dis beyazlatma kalemi
Hi everyone I am a adwords voucher addicted.I really appreciate this blog.thanks for sharing those instructive posts
Muchas gracias, este post me sirvió de mucho, sobre todo por que ya no tendré que utilizar los campos personalizados y el cliente podrá ver lo que tiene que hacer en pantalla, pero quisiera saber si hay alguna forma para hacer un metabox para subir imágenes, no sólo pegar una URL.
Muchas gracias…
What a great blog. I appreciate your work. If only you talk about how to refinance student loan it will be amazing.anyway thanks for sharing
Thanks for this great tutorial! I didn’t know you could add new panels for your custom fields. Will try it out!
Hi! I have a brand new, original, wordpress design with a “sketching” theme.. Check it out if you want =) Hope you like it! (hope you like my footer aswell)…..
I don’t quite understand what you mean exactly by implementing RSS. Could you go into detail about what you’re looking for?
perhaps this was not the good idea, in fact, I don’t really like Tommy Grebbish all that much.
Offering free tools for blogs and Web sites – weather tools, news and Prayer:ç?fl?lflff
Definitely your page is worth bookmarking and I am going to do that and yes, thanks for all that valuable hard work you have shared. I must show this to our expert team of Web Designer in London & yes nice compilation and thanks for that hard work.
Nice work Spencer. I was really looking for a post like this. Many thanks for your help.
im anewbie with wordpress…..where is functions.php file is locaed…..i cant find it……or if uploading is to be done then,where…..?