ALEW, advanced layout plugin for WordPress

May 19th, 2006 ericdes

I’ve started to write this plugin to have a greater control over some layout features in WordPress. I’ll add more functions as I feel a need for new features or get any suggestions.

Download links:

ALEW 1.1 (tgz)

ALEW 1.1 (.zip)


alew_teaser ( [string min_height [, string max_height [, string more_link_text [, string allowable_tags]]]] )


This function may replace the_content() when you want to display only the teaser. alew_teaser(), in a same manner, will force WordPress to display the part of the post (or page) above the quicktag <!–more–>. the_content(), on the contrary, lets WordPress choose on its own whether it should display the teaser or the full content.

Typical use:

// This will show a teaser, on which
// you can click to display the full content.
query_posts('pagename=dummy');
if (have_posts()) {
  the_post();
  alew_teaser();
};

The equivalent to

the_content('(more...)');

is:

alew_teaser(NULL, NULL, '(more...)');

Some additional features have been added:

alew_teaser(NULL, NULL, '<!--no-link-->');
Will display the teaser with no link to see the full content. You won’t be able to click on it either.
alew_teaser('150px', '200px', 'More...');
Will put the teaser in a css box of no less than 150px high and no more than 200px. It doesn’t work on all browsers, in particular IE6 won’t handle it, whereas IE7 and Firefox do just fine.

It’ll be handled though by all browsers if min_height has the same value as max_height.
Example:
alew_teaser('4cm', '4cm', 'More...');

alew_teaser(NULL, NULL, NULL, '');
Will show the teaser with all the html tags removed. If the parameter allowable_tags (equal to ” in this example) doesn’t list <img> then the teaser is displayed without pictures, which might be what sometimes you’ll look for. This feature is based on the php function strip_tags and behaves the same way: the allowable_tags is passed to the strip_tags php function. You can consult the strip_tags function on the php website. If the allowable_tags argument is not passed or set to NULL, the php strip_tags function is not called.
Example:
alew_teaser(NULL, NULL, 'More...', '<b></p> <hr /><img></p> <h3>');
will only keep the <b>,</p> <hr />, <img>, and</p> <h3> tags, and remove all others.
Notice: The </p> <p> tags cannot be filtered.

CSS class: alew_teaser() creates the link to the full content with a CSS class named more , which you can customize in your template.


alew_excerpt ( [string min_height [, string max_height [, string more_link_text [, string allowable_tags]]]] )


This function will display the excerpt of a page. Use it the same way as alew_excerpt. It offers more layout options than the_excerpt.
If no excerpt is present for the page, then this function will display the teaser.
Notice: The </p> <p> tags can be filtered (unlike in the alew_teaser function).

Entry Filed under: WordPress plugins

9 Comments Add your own

  • 1. 3dsl Eugen  |  December 9th, 2006 at 8:29 pm

    wow, that is exactly what I looked for. big thanks for tool!

  • 2. Tobias  |  December 13th, 2006 at 12:14 am

    What I want to do on my blog, is every few hours take the oldest post and move it to the
    front of the queue, all automatically. Anyone know if there is a plugin that can do this or
    a simple way to set up another plugin to do this (use my own feed perhaps)?
    Thanks.

  • 3. Die besten WordPress Plug&hellip  |  April 22nd, 2007 at 1:06 pm

    […] ALEW - advanced layout plugin for WordPress A set of functions that gives you a greater control over some layout features in WordPress. […]

  • 4. lilu  |  April 30th, 2007 at 5:22 pm

    this not worked with last wp upd. :( or I`m do something wrong?

  • 5. Mark  |  May 16th, 2007 at 4:51 pm

    Can you (or someone else) please post a picture of what this looks like when active? thanks

  • 6. Blog-Sport » Free p&hellip  |  July 15th, 2007 at 5:06 pm

    […] WordPress framework extension for an easier control of design’s layout. See manual at Options | ALEW. By ericdes. Download How install this plugin on wordPress ? […]

  • 7. engaxopefep  |  July 31st, 2007 at 10:33 am

    tela-web.com - The most necessary site !

    I like your great site - tela-web.com .
    Thank for your work for us!
    Thank you, I will add it to my bookmarks

    Best Regards

    Neo

  • 8. Glen Ulmer  |  August 11th, 2007 at 6:20 pm

    This is interesting… in your post, you wrote the “the_content” lets WordPress decide on its own whether to display the full content or not. What about writing a replacement function that lets the programmer decide when the tag is used and when it’s ignored? Or is there already a way to do that?

    Thanks for the tools & thoughts!

  • 9. WordPress Plugins for Blo&hellip  |  March 11th, 2008 at 11:05 pm

    […] you varying control over the look of your post excerpts include Evermore Excerpts WordPress Plugin, Advanced Layout Plugin For WordPress (ALEW), and The Content Extract Plugin, which creates an extract of your post for an excerpt, putting it […]

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed