WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to increase rows of VALUE field for Custom Fields? (7 posts)

  1. syncbox
    Member
    Posted 4 years ago #

    I'm using 2.8.5, but it's not listed in the menu for version yet, sorry.

    Question: is there some way to increase the number of rows in the textarea field of the custom fields "value" field? (In Create New and Edit Pages and/or Posts)

    I know I could probably hack this in the admin, but wondered if you gurus out there either knew of a plugin for this or some better way to make the change? I know WordPress lets you increase the size of the content box... what about the size of the value field for custom fields? They are SO tiny but SO useful!

    Thanks in advance to anyone with an answer for this.

  2. mtw28
    Member
    Posted 4 years ago #

    Here's a good guide that outlines six different ways to approach this through plugins or built-in theme changes. http://www.kevinleary.net/6-ways-to-create-custom-write-panels-in-wordpress/. The easiest approach looks like using the More Fields plugin.

    I agree, though, better native support for custom field write panels would be really great!

  3. syncbox
    Member
    Posted 4 years ago #

    Wow, thanks... PODs sounds really exciting, but a bit much for what I am doing at the moment. Can't wait to try it out on my next complex WordPress site...

    Custom Field Templates look adequate for what I need at this point. I love C2C's get_custom() functions but they don't do anything in terms of aiding the editor in the admin --

    Thanks again... very informative link you sent.

  4. Mark / t31os
    Moderator
    Posted 4 years ago #

    You can alwasy apply your own CSS in the admin area, and just increase the size via CSS.

    If you've not got any solutions by the time i check back tomorrow i'll post something up for you.

  5. syncbox
    Member
    Posted 4 years ago #

    I'll look at using CSS for it, but even that is something that can be overwritten because it's in the admin, not the theme...

    I've actually started playing with more fields, which does work in 2.8.5 despite warnings, though you have to change a couple of lines of code in a couple of files.

  6. Mark / t31os
    Moderator
    Posted 4 years ago #

    Sorry no, i think you're misunderstanding me.

    To clarify, it is possible to use a function to hook your own CSS into the admin area. No core file edits are required.

    As soon as i've got some spare time to test code i'll give you a clear example of what i have in mind.

  7. Mark / t31os
    Moderator
    Posted 4 years ago #

    Assuming you're targetting the new field box..

    Add this to your theme's functions.php

    add_action('admin_head','custom_field_css');
    function custom_field_css() {
    	echo '
    	<style type="text/css">
    		textarea#metavalue {
    			height:150px!important
    		}
    	</style>
    	';
    }

    You can target the additional fields that are added once you click "Add Custom Field", but it'll require a CSS selector, which will work, so long as you use an upto date browser (older browsers don't support all the CSS selectors).

    Let me know if you need further help.

Topic Closed

This topic has been closed to new replies.

About this Topic