Secondary HTML Content is a WordPress plug-in that adds a second block of HTML content to your pages and / or posts, making it easy to facilitate sidebars and two-column layouts!

Version 1.5 update released November 4, 2009!

Download version 1.5 from the WordPress plug-in repository »


Description

Add a second block of HTML content to WordPress pages and / or posts. A perfect solution for layouts with two distinct content areas or “blocks”, such as a sidebar or two column view. When editing content, a second WordPress WYSIWYG content editor will appear beneath the standard page editing block. The content in this second block can be used by adding the new widget (“Content Block 2″) to your sidebar, or calling in the content in your template.

You can choose to add the feature to pages, posts, or both. When using with pages, you can optionally inherit secondary HTML content from the page’s ancestory (parents, grandparents, etc). Perfect for section-wide sidebars.

The content in this second block can be used by adding the new widget (“Secondary HTML”) to your sidebar, or calling in the content in your template. To echo its content on the page, use the function the_content_2(). To retrieve the content without echoing it onto the page, use get_the_content_2(). Both functions optionally take a post ID parameter which, if provided, will return the secondary content for that page or post. When no page ID is provided, the functions will attempt to retrieve the secondary content for the current page or post.

Future updates will include an optional global widget heading.

Add a second block of HTML content to WordPress pages. A perfect solution for layouts with two distinct
content areas or “blocks”, such as a sidebar or two column view. When editing a page, a second WordPress
WYSIWYG content editor will appear beneath the standard page editing block.
The content in this second block can be used by adding the new widget (“Content Block 2″) to your sidebar,
or calling in the content in your template.
To echo its content on the page, use the function `the_content_2()`. To retrieve the content without echoing
it onto the page, use `get_the_content_2()`. Both functions optionally take a page ID parameter which, if
provided, will return the secondary content for that page. When no page ID is provided, the functions will
attempt to retrieve the secondary content for the current page.
A future update will include some configuration options, including an option to add the feature to posts
(the feature is “pages” only for now) and an option to specify a heading for the widg

This plug-in has only been tested with WordPress 2.8.4 and 2.8.5. It should, however, work with any build of WordPress 2.8.

Installation

  1. Install easily with the WordPress plugin control panel or manually download the plugin and upload the extracted folder to the `/wp-content/plugins/` directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Optionally configure with the new “Secondary HTML” menu option under “Settings”
  4. Start entering secondary page content! Output using the widget by going to the widget menu under apperance, or use the get_the_content_2() and the_content_2() functions in your template!

Screenshots

Video Tutorial (for 1.0) by WordPressModder

As always, feedback and suggestions are welcome!

38 Responses to “Secondary HTML Content (WordPress plug-in)”

  1. Ken says:

    Great! I recently designed a site with two columns of content. Text on the left and Photos on the right. Side bar is in the footer. The client needs a very visual dashboard and I think I can make this work. One request: can you add the Upload/Insert media icons to the Secondary HTML pane? Pretty minor, huh?
    Being a designer and not a coder, I had to get assistance to understand how to implement the code on page.php. But I got there. Thanks.

  2. Ken says:

    Please inform me when you add the feature to Posts.

  3. Jake Goldman says:

    Ken – we’ll be incorporating media buttons as well as an option to add to posts in a forthcoming update. In the interim, for media, you can insert it in the regular HTML area and cut and paste it into the Secondary HTML Content block.

  4. Kjetil says:

    Hi
    This looks interesting!
    If I understand this correctly, your plugin provides a page- (and soon post-)wise sidebar widget. One just have to add one widget in the widget panel – and then get the possibility to have different content in the sidebar of different pages (/posts) – right?
    A postwise possibility and a header (which preferably allows html) would be great!
    Thanks,
    Kjetil

  5. Jake Goldman says:

    Kjetil – that’s the idea. We’ll be adding an option to add it to posts. You’ll also be able to a global heading for the widget (i.e. “Additional Thoughts”). If you want unique headings on each page / post, just put a heading in the HTML content area. If you open up the second toolbar (the “kitchen sink”), there’s a heading format drop down.

  6. Hi, i downloaded the plugin and activated it, i opened the widgets and dragged it to one of my side-bars BUT i get this ”There are no options for this widget.”
    what do i do ?
    I have the latest WP which is 2.8.5

  7. Jake Goldman says:

    Ahmad – The widget itself has no options. You need to add Secondary HTML Content to any page using the new panel. It will show up in the widget when those pages are display!

  8. Kjetil says:

    Great
    Thanks for clearing this up
    - and keep up your good work!

  9. Jesse says:

    Plug-in is amazingly handy. A few questions/recommendations/suggestions:

    1) Permalink compatibility(doesn’t seem to work on my site, the automatic call of the secondary-content associated with the post)
    2)Edit Page seems to load quite a bit slower with this plug-in activated, is there any way of speeding up this load time? [same on local server as external server]

    Obviously neither of these is a deal-breaker, the plug-in is amazing and makes extra content extremely easy for un-familiar users to input.

    Thanks!

  10. Jesse says:

    Never mind on either count. I was spacing a few things. I would be excited for the addition of media buttons, can’t wait for the update.

  11. Mark says:

    This plugin sounds great but I am having a little difficulty with it. Please forgive me, I am a designer and not a programmer.

    After installing it and activating it in the plugin menu, I get the new HTML box appearing in my posts and pages. However, when I enter text into the box, it does not appear on the page. I see that I am supposed to use the function `the_content_2()` or `get_the_content_2()`. Only I am not quite sure how to do that. Any advice would be greatly appreciated!

    Thanking you in advance!

  12. Jake Goldman says:

    Mark – I’ve added a video tutorial put together by WordPressModder that might help you out. The easiest way to get them to show up is to go to “Widgets” under “Appearance” and drag and drop the “Secondary HTML” widget into a sidebar, where you want it to appear.

  13. Ken says:

    This is great. I need this for a site I just did http://thepastures.net/ but I hit some bumps that might be useful to cover. As you see, I have two content areas; the left hand TEXT column and the right hand IMAGE column. Currently I am using CSS to move the Images to the right. I need to keep this simple for the client and having the secondary content pane in the dashboard will be a big help.
    First, I am a designer and not a programer so I needed some help getting the code into my php templates. I did get everything to work for Pages on my test site: http://kennethbsmith.com/clients/wp01 (this is a WP test site for me, so the content is different, but I hope you can see that the style and functionality are the same as the client retreat site)
    I used this class:
    .rt400{
    width: 400px;
    margin:0 35px 0 0;
    text-align:center;
    float:right;
    border:1px dotted red;
    }
    and inserted this into pages.php, index.php and single.php

    Everything is working except on NEWS (the Home Page for the Posts.) I this clear?
    With help, I revised index.php using

    ID ); echo ‘‘.$post->ID.’‘; ?>

    So, I am not getting the secondary content for the posts on the Home page.
    What do you suggest?
    Let me know if I need to explain this in more detail or offer more information.
    Thanks

  14. Ken says:

    Unfortunately my code is not appearing in the comment I just made. What should I do to show you the html and php code I am using?

  15. Ken says:

    [html]

    ID ); echo ‘‘.$post->ID.’‘; ?>

    [/html]

  16. Jake Goldman says:

    Hey Ken – sorry for the belated response.

    I know what the issue is, and will try to release an update next week that supports your use case.

    The fundamental issue is that WordPress does not treat the “posts page” as a true page. It’s treated as a container for the posts index. But I can work around it with some clever coding.

  17. Joseph says:

    This is a very good plug-in, flexible easy to understand and works well with my multiple sidebar configuration. I would like to congratulate you on an excellent effort!

  18. Joseph says:

    hi, i am implementing a secondary sidebar on my site, i was wondering if this widget can be made for multiple instances, so that i can use it more than once on my multiple sidebars? thank you!

  19. Matt Rittman says:

    The text color is white when I try to type in the secondary HTML content box… How in the world am I supposed to see what I’m typing?

  20. Jake Goldman says:

    Matt – it’s not doing that in our testing environments and no one else has reported that yet. Do you have any plug-ins installed thy also modify / use the editor? If you open up the “kitchen sink” toolbar and look at the font color, is it set to white? Are you running 2.8.x? A complex theme?

  21. Jake Goldman says:

    Joseph – we’ll target multiple instances for the next update.

  22. Geert van der Heide says:

    I have the following problem:
    I have installed the plugin and activated it.
    In the header-template I putted .
    I get only the text of the “normal” page (2 times).
    See: http://www.restaurant-riethoeve.nl/vankeulen/?page_id=118
    What i’m doing wrong? please help!

    Regards,
    Geert van der Heide

  23. Takingweb says:

    @geert: i have the same problem…i didn’ understand where put the code….i have tryed to put it in my template but i have my second content twice. :(

  24. Jake Goldman says:

    Geert / Takingweb – you need to put the function “the_content_2()” inside a PHP code block. For instance:

    < ?php the_content_2(); ?>

  25. Ken says:

    Jake-
    Any ETA for the POST PAGE fix?

    (JG: I know what the issue is, and will try to release an update next week that supports your use case.
    The fundamental issue is that WordPress does not treat the “posts page” as a true page. It’s treated as a container for the posts index. But I can work around it with some clever coding.)

  26. Robert says:

    Why not just make the plugin so that you can replicate the html box as many times s you want and call it as many times as you want??

  27. antonio says:

    A suggestion and a problem here.

    First, the suggestion: it would be awesome to be able to insert php code and not only html.

    And the problem is that when i upload a picture to the media manager and try to insert into the post area, it always automatically insert it on the secondary html area. Any way to resolve it?

    Thanks for the plugin, it’s a great idea

  28. Jake Goldman says:

    Ken – sorry for the delay, we’ve been really swamped since WordCamp! Will try to knock it out this weekend in a free moment.

    Robert – I suppose we could build a plug-in that facilitates that as well, but from an engineering perspective, the more complicated you make the plug-in, the more overhead it’s going to place on the site.

    I think 95% of those looking for a multi-block solution just want 2 columns (I can’t think of many designs that have more than 2 blocks unique to a given page). So the thinking was to focus on making a plug-in highly optimized for that situation.

    That said, there’s no technical barrier, and an ability to specify the number of blocks you want to use (or letting someone add multiple ones on the fly) is something we’ll put on the road map.

    If anyone (you or otherwise) wants or needs that feature and is willing to sponsor it before we “get around to it” (that’s the way it works with freebies), let me know and we can fast track it!

  29. mrbee says:

    this is great! thanks so much for this plugin!

    my client wants a “related links” for every article and he wanted it to be posted on the sidebar and this plugin saved me from writing my own! :)

  30. mrbee says:

    Hi… I hate to be a nag but I’ve encountered the same problem as Antonio. Whenever I upload an image and insert into the post, it will automatically insert into the secondary content.

    The uploaded image doesn’t appear on the post’s gallery as well. I had to grab the links from ‘media manager’ as if the media is attached to other post.

    I’m using WP 2.8.6, your plugin version 1.5. Tested both on Chrome 3.0.195.33 and FF3.5.5, running on Win XP.

    Thank you so much! :)

  31. Dietrich says:

    It’s exactly what I need and looked for. Thank you for this great work.

  32. Phil says:

    I’m on WP2.8.6 and whenever i enter something into the secondary content panel, it saves fine. If i then go back to edit the page, all the formatting ( tags ) are lost.

    Any ideas?

  33. Jonathan says:

    When I installed qTranslate plugin with the Secondary HTML plugin, the text disappeared in the post / page editor.

    From their site:http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=294
    qTranslate tries to modify every String it can get its hand on, but unfortunately, custom Plugins often don’t supply filters nor use Gettext for their Strings, so it is impossible for qTranslate to filter out the correct language.

    It would be great if I could use your plugin with qTranslate. I don’t know enough about PHP to make the small changes myself.

  34. Jake Goldman says:

    Jonathan – can you explain the “disappeared” comment a bit more? The text in the secondary HTML block disappears?

    Getting a bit technical here, but we apply the same filters to secondary HTML that are applied to the regular HTML block on save and output. Those include shortcode processing.

    I’ll try and find some time to look into general shortcode handling with secondary HTML content, but can’t really invest “free” time in compatibility with a single plug-in. If this is a priority, and you have a budget, you could certainly “sponsor” full qTranslate support. If you’re interested, contact us.

  35. Adam says:

    Would I be able to create more “HTML Content Boxes”? For example, with this plugin by placing “the_content_2()” I get a second “Content Box”. If I were to place “the_content_3()” would I get a third “Content Box”?

    This would be great for pages that have alternating 2, 3, 5, or even 10 columns of text. One could add as many separate text boxes of static text as needed.

    This plugin is so close to being a perfect answer for me. Thanks for all your work! I’m glad that you can code PHP. I wish I could. :)

  36. Jake Goldman says:

    Adam – this plug-in only enables a second content box. While we could write a plug-in enabling unlimited boxes, we saw that as a rare use case (few sites have more than 2 unique boxes per page) and didn’t want to add more performance reducing overhead to the plug-in.

    It’s certainly feasible to do that, however.

  37. Lee says:

    Thanks for releasing this plugin – like many here, it’s something I need for the site I’m creating. I’m a bit confused, forgive me, but is there some way to only have the two content boxes appear on one page?

    I only need the two content boxes to display on the home page, but when I activate the plugin, the two content boxes display on all the pages.

    I’m using WordPress as a CMS, no posts, only Pages.

Leave a Reply