Dynatags

Dynatags is a WordPress plugin that lets you to create up to 10 short tags without writing a single PHP code row.

Download

It can be download from WordPress Plugin Ditectory.

Introduction

How great is to have the shorts tags (the ones like [aaa param="value"]) in WordPress to embed things or add features to a post?

Good! Now you can create your own short tags without writing a plugin. And if you are a PHP programmer you can write your code within a configuration page. This is what I call productivity!

Usage

Is really simple to use Dynatags. Lets go with an example. You want to define a short tags to embed an ad from Tradedoubler/AdSense/Zanox in some posts but want to have a way to control it from a centralized place. Not only: you need to change the ad whenever you need (to update it) without touching the posts.

  1. Choose a name for your short tags: let it be “onlinedate”
  2. Add the ad code (HTML and JavaScript are good) in the code block
  3. Go to a post and add this in the body (dynatag name=”onlinedate”) with round paranthesis chenged with square ones

That’s all.

Advanced examples

Now we try to use PHP code. First, our mission: print the user ip address within a post. It’s stupid, I know.

  1. Choose a name for your short tags: let it be “ip”
  2. Add the PHP code below in the code block
  3. Go to a post and add this in the body (dynatag name=”ip”) with round paranthesis chenged with square ones

The PHP code can looks like:

<?php echo “Your IP is: ” . $_SERVER['REMOTE_ADDR'];?>

It’s working? Look below:

Your IP is: 72.46.156.117

More complicated: use the short tag parameters. We want to call the tag passing two parameter, like this:

(dynatag name=”ip” param1=”test 1″ param2=”test 2″)

the PHP code to use those parameter i like that one:

<?php
echo “Parameter 1 is: ” . $attrs['param1'];
echo “Parameter 2 is: ” . $attrs['param2'];
?>

Flexible, isn’t it?

Help and support

Please, read what other have written and the answers I gave here. Ask your questions here.

Versions

I’m too lazy to update this page for new version, check this blog for the tag dynatags versions.


Leave a Reply