How to add my custom shortcode

Posted in: Newspaper
Post count: 2

Please explain how to create MY NEW simple shortcode, that will by listed in shortcodes dropdown in WYSIWYG editor.

Very important feature is to prevent overwrite it when i update Newspaper theme >> Maybe some kind of my_custom_shortcodes file or database insert?

Post count: 22421

Hello,

If you plan to modify the theme files in order to add content to the shrotcodes tab, this will not be update proof at all as any change in the theme files will result in the loss of the customization (even if a child theme is used) so the best option would be through a plugin. You can create your own plugin and tie it to the editor by following a few online resources:
http://wordpress.stackexchange.com/questions/72394/how-to-add-a-shortcode-button-to-the-tinymce-editor
http://code.tutsplus.com/tutorials/guide-to-creating-your-own-wordpress-editor-buttons–wp-30182

Or maybe you can find a plugin that already has the options you seek: https://wordpress.org/plugins/better-shortcodes/screenshots/

Hope this helps.
Thank you!

Post count: 2

Thank you Bogdan for help and useful links.
I have got all my needs with combination of “Better shortcodes” + “Shortcoder” plugins.

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.