WordPress is a great CMS, but implementing some features within your theme can require a little lateral thinking. The content for your page or post is usually output by the theme code using a single function call:
the_content(args);
But what if you need to split the content into two or more blocks? That might be necessary if your theme requires multiple columns or sections on the page. WordPress provides a get_the_content() function to return content as a PHP variable, but how do you determine where the divisions occur? There are a few solutions on the web, but most involve either:
- Splitting the content at HTML tags such as
h2headings. Unfortunately, that requires the content author to know a little HTML and it’s not very versatile — you couldn’t allow two headings in one column. - Using a WordPress shortcode. That’s more flexible, but it still puts the onus on the content editor to remember and use the right code.
The WordPress <!--more--> tag may offer a better solution. It’s normally used to split a long article into two or more pages, but not all themes use that facility and it only works for WordPress posts by default (not pages). Using the <!--more--> tag offers several advantages:
- A “more” toolbar button is available in both the visual and HTML editing pane.
- Divisions can be placed anywhere in the content.
- It’s easy for non-technical users to understand how the content will be split.
To split your content, locate your theme folder (wp-content/themes), edit or create a functions.php file and add the following function within a <?php … ?> block:
Last 5 posts in Blogging
- Time to rename your Recycle bin to Crazy names-bored with the same old name “Recycle Bin” change it - July 14th, 2010
- Alcatel Launches One Touch Yahoo Powered Net mobile handset manufacture by TCT Mobile - June 17th, 2010
- How to Format or Reset all the settings in an ipad? - June 14th, 2010
- Adobe Releases the fix-up for Flash Bug with new update - June 14th, 2010
- Free Black & Gray WordPress theme with Professional Look - June 8th, 2010

{ 1 comment… read it below or add one }
Beautiful themes! Gonna try most of them on my wordpress site.