Skip to content
WJunction - Webmaster Forum

Tutorials & Guides Add Your Own WP Quicktags

Status
Not open for further replies.
Ever wondered how to add your own "quicktags" in wordpress for quickness of just clicking a button?

Here is a tutorial written by me on exactly how to do that.

First off you will be working with 3 files:

quicktags.js
quicktags.dev.js
style.css

Now to edit the files:

Open up quicktags.dev.js located in your wp-includes folder and add in this code

PHP:
edButtons[edButtons.length] =
new edButton('ed_span_class'
,'strong'
,''
,'</strong>'
,'s'
); // special case
This is the code for the "bold" function, all you do is edit the words "strong" to whatever you want your button to say.

save that and then re-upload it.

Now open up quicktags.js

add in on one line the exact same code but on one line as such
PHP:
edButtons[edButtons.length] = new edButton('ed_span_class' ,'span' ,''
,'</span>' ,'p' ); // special case
Save that then re-upload it

(obviously you would edit this to whatever the code was that you just put in the quicktags.dev.js)

Now to edit the style.css

Go to the very bottom of the stylesheet & add:

PHP:
info {
 css here, whatever you want your quicktag to do
}
Hope it makes sense, just thought i would share it as i have only just learned how to do this about 10 minutes ago XD
 

2 comments

In WP you have quicktag buttons so you can click them and it generates code.

Example:

Strong = <strong></strong>

Well this tutorial allows you to edit / add new quicktags
 
Status
Not open for further replies.

About the author

B
Senior Member · Joined
1,286
Messages
211
Reactions
63
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom