WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Please look at it here TAG page morsblog [dot] dk/tag/stranden/

For THIS TAG, I want to write some text in WordPress (it should have possibility to add defined text to any defined tag). It should look something like this: http://farblog.dk/tag/motorsav-bukser/

Is it possible to make a little plugin that make the text be shown, and providing an opportunity to display the Adsense code below?


share|improve this question

You can add a tag description by editing the tag in your WordPress admin (Posts > Post Tags), then use the following code to display the description in your template file:

$tag = $wp_query->get_queried_object();
echo $tag->description;
share|improve this answer

In my previous theme I made some code for this, though not in plugin format.

I not only wanted to add some text but for specific tag pages other theme layout, other sidebar, other header, etc...

For this I made the structure to make directories /inc/tags/ in the theme directory.

Then ... there is quite some code but e.g.my tag.php looked liked this:

$tagname = get_query_var('tag');
$tagdirectory = TEMPLATEPATH . '/inc/tags/' . $tagname . '/';
$includedirectory = TEMPLATEPATH . '/inc/';
include ($includedirectory . "directorytag.php");
     include ($includedirectory . "header_top.php");

<div id="maincontent">
        if (file_exists($tagdirectory . "header.php")) {
        include ($tagdirectory. "header.php");
        if (function_exists('postbar')) postbar();
        include ($includedirectory . "loop_tag.php");
        if (function_exists('postbar')) postbar();
<div id="sidebar">
            include($includedirectory . "sidebar_tags_top.php");
            if (file_exists($tagdirectory . "sidebar.php")) {
            include ($tagdirectory . "sidebar.php");
            include($includedirectory . "sidebar_tags_bottom.php");
    <?php get_footer(); ?>

The idea behind it was like this:

I think someone who just starts with blogging without a real purpose will blog along... and during the years he will discover that he wrote quite a lot about some things indicated by a greater amount of tags. So these more interesting tags give both some insight in his interests and lead to kind of subsite based on these tags. So very "evolutionary" as opposed to "I have these interest and will start a wp multisite on these topics".

So (technically) : as soon as you add a directory under the /inc/tags/ directory with the name of the tag you can add files like "header_top.php", "sidebar_tags_top.php" etc... and... if a certain tags has really specific functionality you can also include it in the loop to show up on the page. You could even add a total different application in the tag directory as time goes by. Therefore: since many combinations are possible this is not really pluggable.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.