theme development - How do I change the tagline input to textarea?

I have had looked around for a while without success. I would like to make the default tagline editor in the Wordpress a

I have had looked around for a while without success. I would like to make the default tagline editor in the Wordpress admin area being rendered as <textarea></textarea> instead of <input type="text"> element. Is there any way to do it?

The tagline inputs I am talking about can be found in wp-admin > Settings > General and wp-admin > Appearance > Customize > Site Identity.

I have had looked around for a while without success. I would like to make the default tagline editor in the Wordpress admin area being rendered as <textarea></textarea> instead of <input type="text"> element. Is there any way to do it?

The tagline inputs I am talking about can be found in wp-admin > Settings > General and wp-admin > Appearance > Customize > Site Identity.

Share Improve this question asked Jun 6, 2019 at 16:30 Norbert BiróNorbert Biró 1011 bronze badge 2
  • The tagline is output within the <title> tag of the website. It does not support line breaks or HTML or anything you're thinking of adding. If you're trying to have something different in your header, then you'd be better of creating a child theme and modifying the header directly in that. – Jacob Peattie Commented Jun 7, 2019 at 8:38
  • I dont want to support line breaks, but the tagline is quite long which will be cumbersome for the admin to edit in the current <input> element. Recently they need to copy the text from the input into a text editor, edit it, then copy the edited text again into the input box. That's why it would be nice if I could replace it with <textarea>. @JacobPeattie – Norbert Biró Commented Jun 7, 2019 at 11:17
Add a comment  | 

1 Answer 1

Reset to default -1

I could be wrong but I don't think there's an easy way to modify these fields generally, you'd probably need to use a bit of JavaScript in the admin to manipulate the field when the page loads to change it from an input to textarea.

I've not tested this, but something like this in jQuery might work if triggered on page load:

$( '#blogdescription' ).replaceWith( '<textarea id="#blogdescription" name="blogdescription" aria-describedby="tagline-description" class="regular-text">' + $( '#blogdescription' ).val() + '</textarea>' );

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745431075a4627392.html

相关推荐

  • theme development - How do I change the tagline input to textarea?

    I have had looked around for a while without success. I would like to make the default tagline editor in the Wordpress a

    11小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信