=== Content Regions === Contributors: carlesjove Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5MG5LA5SM6UM4 Tags: content region, text block, idependent content Requires at least: 3.0.1 Tested up to: 3.6.1 Stable tag: 0.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Content Regions lets you create independent pieces of content that can be called anywhere on your templates. == Description == Ever needed a single paragraph somewhere in your WordPress site? Or maybe you'd like your client to be able to edit that motto in the header? Content Regions plugin lets you to do that by creating standalone contents that can be called anywhere on your templates. == Installation == This section describes how to install the plugin and get it working. 1. Download the plugin files 2. Upload `content-regions` to the `/wp-content/plugins/` directory 3. Activate the plugin through the 'Plugins' menu in WordPress 4. Start creating content regions ;-) == Changelog == = 0.2 = * Return values are filtered, so shortcodes work * Returns error message if the field is invalid == Usage == You can access your content regions in different ways. The easiest is by using the `content_region( $region, $options )` function. By default, `content_region( $region )` will echo the content field of the region. Other options are: `content_region( $region, [$options] ) // echoes the content field. Accepts, $options` `content_region_title( $region ) // echoes the title field` **Example:** You have created a Content Region titled *My content region*, with post-name `'my-content-region': `content_region_title( 'my-content-region' ) // echo the title` `content_region( 'my-content-region' ) // echo the content` `content_region( 'my-content-region', array('field' => 'title', 'echo' => false) ) // Get the title, but do not echo it` Of course, you can retrieve regions the good ol' WordPress way, with a `WP_Query`: $loop = new WP_Query(array( 'name' => 'my-content-region', 'post_type' => 'content-region', 'post_status' => 'publish', 'posts_per_page' => 1, )); if( $loop->have_posts() ) { while ($loop->have_posts()) : $loop->the_post(); the_title(); the_content(); endwhile; }