Plugin Directory

HTML Helpers

This plugin adds simple HTML tag generation API to WordPress.

This plugin adds simple HTML tag generation API to WordPress, like these examples:

<?php img('wordpress'); ?>

generates and prints <img src="/wp-content/<your-theme>/images/wordpress.png" alt="WordPress" />.

<?php _img('http://example.com/images/wordpress.png', 'alt', array('id' => 'my-image')) ?>

generates and returns almost the same tag, just with absolute url, id and alt attributes set manually.

<?php select('category', collection2options(get_terms('category'), 'term_id', 'name'), $term->term_id) ?>

generates select tag with options taken from WP 'category' taxonomy and sets $term as selected item

<?php cycle(array('odd', 'even')); reset_cycle(); ?>

rails-like "cycle" that returns "odd" on first call, "even" on second, "odd" on third call, so on. reset_cycle resets the cycle.

<?php the_post_meta('meta_name') ?>

shortcut for echo(get_post_meta($id, 'meta_name', true))

Form field generators for text, checkbox, hidden input types, textarea, and more tags. More docs coming soon, you can read the code to figure out other features for now.

Requires: 1.5 or higher
Compatible up to: 3.1.4
Last Updated: 2011-6-16
Downloads: 390

Average Rating

5 stars
(1 ratings)

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

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

100,1,1
100,1,1 100,1,1
100,1,1