WP-EmbeddedCode

1.0

October 29, 2008

The WP-EmbeddedCode plugin enables you to insert Style, Script, and PHP codes in to your WordPress posts. You may wonder why inserting style or script in a post needs a plugin, because you can directly insert them in a post. The problem appears when user uses a feed reader to read your post. Some feed readers fail when there is an embedded style or script in the content.

The WP-EmbeddedCode plugin define three shortcodes for embedding style, script, or PHP codes in to a post.

Inserting CSS Style

To insert a CSS style in your post, wrap the CSS code in these tags: [style]…[/style]

[style]
p {
  background-color: green;
  color: yellow;
}
[/style]

The style shortcode accepts two parameters:

  • Type
    Determines the mime type of the style. The default value is “text/css”.
  • Media
    Specifies the media type of the style. The default value is “all”.

When user is reading the post inside a feed reader, the style does not appear in the post.

Inserting Script

To insert a script in your post, wrap the code in these tags: [script]…[/script]

[script]
alert("I am the script");
[/script]

The script shortcode accepts one parameter:

  • Type
    Determines the mime type of the script. The default value is “text/javascript”.

When user is reading the post inside a feed reader, the script does not appear in the post.

Inserting PHP

To insert PHP code in your post, wrap the code in these tags: [php]…[/php]

[php]
echo 'This is the list of categories:';
wp_list_categories();
[/php]

The php shortcode does not accept any parameter.

Download

  WP-EmbeddedCode (8.8 KiB, Last updated on October 29, 2008)
Enables you to embed Style, Script, and PHP codes in your WordPress posts.

Leave a Reply

Required fields are marked with asterisk (*)