Conditional comments for the length of a post
I would like to include extra content alongside each post based on the length of the post, i.e. if a post is under 500 characters, show a short banner. If it’s over 500, show a medium size banner. And if it’s over 1000 characters, show a long banner, etc.
My site is http://dotneil.com . I plan to put this additional content in the <dl> to the left of each post – so it will be in the Loop. I’m okay with conditional comments for pages, sidebars etc, i.e. <?php if(is_single())?> etc, but I don’t know how to make conditional comments work via queries against the length of a post.
I think this would make quite a handy plugin if it had a simple interface for choosing the character increments (i.e. 500 words) and the content rendered at each increment, especially if it’s implemented in the traditional sidebar via a widget…or maybe this plugin exists and I just don’t know about it!?!
- The topic ‘Conditional comments for the length of a post’ is closed to new replies.