My client wants to have several pages in which he can edit small, separate parts of a Wordpress page. For example, there is a callout box in the upper left corner. There is also a small piece of text showing contact information in the lower right corner. I'd like to be able to have all of these pieces of text editable in the same place.
My idea is to have a post structured using shortcodes; something like this:
[top-callout]
This is the top callout text.
[/top-callout]
[bottom-contact-info]
341 Address Rd.
City Comma State 23422
[/bottom-contact-info]
[other-text]
...
[/other-text]
and so on. Is there a way to extract the content of the shortcodes into loop variables? That way in a theme php file I could do something like:
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
...
<?php echo $post->top_callout; ?>
...
<?php echo $post->bottom_contact_info; ?>
...
<?php endwhile; ?>
Or, is there a better way to do this?