Plugin Directory

Artiss Code Embed

Artiss Code Embed (formally Simple Code Embed) provides a very easy and efficient way to embed code (JavaScript and HTML) in your posts and pages.

Download Version 1.6.1

Artiss Code Embed (formally Simple Code Embed) allows you to embed code - JavaScript and HTML primarily - in a post. This is incredibly useful for embedding video, etc, when required. It cannot be used for server side code, such as PHP.

This plugin works for both posts and pages. However, for simplicity I will simply refer to posts - bear in mind that pages work in the same way.

Options Screen

To use first of all visit the options page. In the Administration menu, under the Settings section there will a new settings option titled "Code Embed". Click on this and an options screen will appear.

Code embedding is performed via a special keyword that you must use to uniquely identify where you wish the code to appear. This consist of an opening identifier (some that that goes at the beginning), a keyword and then a closing identifier. You may also add a suffix to the end of the keyword if you wish to embed multiple pieces of code within the same post.

From this options screen you can specify the above identifier that you wish to use. By default the opening and closing identifiers are percentage signs and the keyword is CODE. During these instructions these will be used in all examples.

Embedding

To embed in a post you need to find the meta box under the post named "Custom Fields". If this is missing you may need to add it by clicking on the "Screen Options" tab at the top of the new post screen.

Now create a new custom field with the name of your keyword - e.g. CODE. The value of this field will be the code that you wish to embed. Save this custom field.

Now, wherever you wish the code to appear in your post, simply put the full identifier (opening, keyword and closing characters). For example, %CODE%.

If you wish to embed multiple pieces of code within a post you can add a suffix to the keyword. So we may set up 2 custom fields named CODE1 and CODE2. Then in our post we would specify either %CODE1% or %CODE2% depending on which you wish to display.

Don't forget - via the options screen you can change any part of this identifier to your own taste.

Global Embedding

From version 1.6 onwards you can use global embedding - that is creating one piece of embed code and using it in multiple posts or pages.

To do this simply make reference to an already defined (but unique) piece of embed code from another post or page.

So, let's say in one post you define a custom field named CODE1. You can, if you wish, place %CODE1% not just in that post but also in another and it will work.

However, bear in mind that the embed code name must be unique - you can't have defined it in multiple posts otherwise the plugin won't know which one you're referring to (although it will report this and list the posts that it has been used in).

If you need help with this, then a new administration option is present under "Tools" named "Embed Code Search". Use this to search for specific embed names and it will list all the posts/pages that they're used on, along with the code for each.

For help with this plugin, or simply to comment or get in touch, please read the appropriate section in "Other Notes" for details. This plugin, and all support, is supplied for free, but donations are always welcome.

Author: dartiss

Requires: 2.0 or higher
Compatible up to: 3.2.1
Last Updated: 2011-9-22 Downloads: 16,198

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(10 ratings)

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

Log in to vote.

100,1,1
100,1,1
100,1,1
100,2,2 100,1,1
100,1,1
100,1,1
100,1,1
50,2,1
100,1,1
100,1,1