WordPress.org

Ready to get started?Download WordPress

Forums

defining your own tags (10 posts)

  1. public_radio
    Member
    Posted 9 years ago #

    I noticed that iimage gallery inputs a <gallery> tag into the body of the post, which then outputs as nested divs. I need something like this for my blog. How do you create tags that stand for code? I know the <!--more--> tag outputs html, but I don't know how to create my own tags. For instance, I would like to be able to input <picframe>image</picframe> and have it output as <div><div><div>image></div></div></div>.

  2. public_radio
    Member
    Posted 9 years ago #

    or <div><div><div>image</div></div></div>, rather. but you get the idea.

  3. public_radio
    Member
    Posted 9 years ago #

    thanks, but i'm familiar with that tutorial and I'm not looking to make my own quicktags. The <!--more--> 'quicktag' isn't a quicktag at all; rather it's a tag you put into the post that represents the html code that is output in the post. I want to know how to create my own tags.

  4. Kafkaesqui

    Posted 9 years ago #

    You would have to write something (i.e. a plugin) that would parse post content for your homemade tag and translate it to whatever your tag is supposed to represent in X/HTML lingo. I'd look at the source of current plugins, like those that handle bbcode tags and such, to see what's required.

  5. public_radio
    Member
    Posted 9 years ago #

    good idea. off hand, can anyone think of a plugin that uses its own tags? I know exhibit creates an <!--exhibit--> tag, and iimage gallery creates a <gallery> tag, but it would be nice to look at some other ones to see if i can find a simpler script to try and emulate.

  6. Kafkaesqui

    Posted 9 years ago #

    If you're not planning on doing anything special with your own tags (like provide attributes), this should do it:

    http://guff.szub.net/source/my-tags.php

  7. Michael Bishop

    Posted 9 years ago #

    K, I love the rant tag, I just may have to play around with this for my own amusement.
    And so with that, could the previous mentioned tutorial for adding quicktag buttons be used for user created tag?

  8. Kafkaesqui

    Posted 9 years ago #

    "And so with that, could the previous mentioned tutorial for adding quicktag buttons be used for user created tag?"

    Why not? The great thing about being able to do the same thing in different ways is, you get to pick your favorite.

  9. public_radio
    Member
    Posted 9 years ago #

    Wow, awesome. Thanks Kafk!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.