Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using the plugin Multiple Content Blocks, which creates separate windows for content so that you can have, say, a 2-column template for a page; one column is editable in the standard TinyMCE window and below it is a second TinyMCE window where you can add/edit the content for the second column. What's nice is that you can work on the page in one place instead, for example, making the second column a "sidebar" and then going to the widgets page and using a Text Widget. I primarily design templates for business sites as opposed to blogs and most of the time content in additional columns aren't widgets.

To create the second window you place this in the template:

<?php the_block('blockname'); ?>

You name the block something, of course. It's nice and simple and there's only 2-3 pages of code with the plugin so it's light.

The only drawback is that you have to create a separate template for each page that uses a content block. But, the developer has in his readme.txt the following:

"Use the function get_the_block instead of the_block, like this:

 <?php $content_to_edit = get_the_block('blockname'); ?> and you can now edit this variable with PHP."

What I would like to be able to do is use one template; specify something to the effect of : if this page, use this block - but I don't know how to write it or even if it is possible. I don't know if I'd have to add something to the functions page as well.

Can anyone advise?

BTW I wrote the plugin developer who replied that he doesn't provide support for the plugin and good luck.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

How about defining a custom page template? If you put /* Template Name: Two Column */ as the first line of your PHP and put the template with the other templates (page.php, home.php, index.php, etc) in your theme, then on the page creation screen there will be an option to select template which you can utilize.

share|improve this answer
    
Figured out that I don't NEED separate blocks. Sometimes the concrete is so thick...I can place one block in a template and it will accept different content from different pages. That wasn't clear to me. Thank you for responding! –  PVA Jan 29 '12 at 17:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.