The MU forums have moved to

creating additional content types (15 posts)

  1. nonrecursive
    Posted 17 years ago #

    Hi all,

    I'm just diving into wordpress mu and so far it's awesome :)

    Right now I'm wondering - is there any way to create custom content other than posts and pages? My client wants to have all content of this type to follow a specific format, and it makes sense to have allow this content to live in its own database table.

    Ideally the content would be able to use the same categories as the blog.

    Alternatively, it could work to use categories to distinguish this content. For example, each new blog could install with an additional category. Each blog post belonging to that category would not show up in the general blog area. If it makes more sense to take this approach, how would I go about doing it?

    I apologize if these questions have been answered elsewhere; I've been searching and haven't the answers yet.

    Thank you!

  2. pumpkinslayer
    Posted 17 years ago #

    What exactly does you client want?

    We need a few more details.

    What exactly does he hope to see on the main page and each blog, what kind of other functionality does he want?

    It's a little unclear from your explanation, or at least I don't quite understand.

    Oh, and posts and pages are the content of a blog, other non-posty like functions often come from plugins. Tell us what you're looking for.

  3. nonrecursive
    Posted 17 years ago #

    My client wants to have a "journal" where each entry has four distinct parts. The main page would display posts from both the journal and blog. In fact, on the front end, the journal will be presented pretty much as a separate blog.

    On the back end, under the "write" section, there will be an additional link that says "Write Journal Entry". The form will contain for separate textareas, each with a heading. It will also need to allow users to send a picture to any one of the text areas.


  4. drmike
    Posted 17 years ago #

    Drupal may be better for your client. It has a built in Journal function IIRC that you can keep seperate from the blog.

  5. nonrecursive
    Posted 17 years ago #

    I've been looking at drupal and as far as I can tell it doesn't have exactly what I'm looking for. With drupal you can create different content types pretty easily, but from what I've seen you can't allow each user to manage his own set of categories, which isn't acceptable. Also, users can either manage *all* comments or none at all, which isn't acceptable either.

  6. drmike
    Posted 17 years ago #

    Hmm, for a moment there I thought knowing all those Open Source projects was going to get me off the hook there. :)

    I'm sitting here looking at the Plugins for something that would work but I'm drawing a blank.

    It's probably doable but at the very least you'd have to rework the wp_posts table to allow for the additional areas. Would have to rewrite alot of code as well to allow for the different post_type.

    I hate to pass you off again but have you raised the issue of the categories and comments in their support forums? I know WordPress has a couple of different plugins to regulate users and their different access levels. I would be very surprised if Drupal didn't.

    That's really the only thing I can think off right off. Andrea may have something when she comes online. She seems to have a better idea of what plugins are out there.

    You may want to bounce this off the wp-pro mail list or over in land as well. I would be very surprised if this hasn't come up in the past.

    I wish I could come up with something for you but I'm drawing a blank.

  7. nonrecursive
    Posted 17 years ago #

    Thanks drmike!

    I might just do something like:

    * Duplicate the "write post" page and change the form to include 4 textareas

    * Generate a normal post from the data sent using this form, except that the post would automatically have headings inserted

    * Attach a "hidden" category, automatically created when a user creates a new blog, to the post.

    * Prevent posts possessing the hidden category from showing up in the general blog

    I'm a little leary of modifying wp so heavily though.

    Thanks again!

  8. dsader
    Posted 17 years ago #

    Several content types, but really just posts styled with a variety of new fields/functions/headings.

    Popular for movie/music reviews. Has an amazon lookup built into the post page. Very well used.

    I have a modified version of this plugin working. Writing new forms for micocontent seems doable. Lots to the plugin is fun to deconstruct.

    Install on a single wp install first. I forget what all I had to do to make it play with mpmu.(change paths add $blog_id etc)

    Doesn't do anything new to categories, though.

  9. nonrecursive
    Posted 17 years ago #

    thanks! so far this is looking really useful.

  10. andrea_r
    Posted 17 years ago #

    "* Attach a "hidden" category, automatically created when a user creates a new blog, to the post.

    * Prevent posts possessing the hidden category from showing up in the general blog"

    Okay, now *this part I've done before. :) Basically, you edit the theme to not show that category in The Loop. Can't find it in the codex at the moment, where I think I saw it, and I'm not at home, where I have themes with the code in it.
    but just having soemone come along and say "yeah, doable" helps. :)

  11. nonrecursive
    Posted 17 years ago #

    thanks andrea! The plugin dsader mentioned help me find the right terms to google, and after the scouring the internet i've done this and so far it works:

    function remove_journal_category_from_frontend_cat_list($content, $category = null) {
    if ($category == null) {
    return preg_replace('/<li><a[^>]+></a>.*?</li>/s', '', $content);
    else {
    if ($category->cat_name == "Journal") return ;
    return $content;
    add_filter('list_cats', 'remove_journal_category_from_frontend_cat_list', 10, 2);
    prevents journal posts from appearing in
    function modify_where_clause_remove_journal_posts($where)
    global $wpdb;
    return $where . " AND ID NOT IN (SELECT post_id FROM $wpdb->post2cat WHERE category_id=3)";
    add_filter('posts_where', 'modify_where_clause_remove_journal_posts', 10, 2);

    I've also altered some code so that, in addition to "uncategorized" and "blogroll", a third "journal" category is always added to a blog when it's created.
    Thanks for your help!

  12. Ovidiu
    Posted 17 years ago #


    care to give more details on what you changed? to get that plugin running?

  13. dsader
    Posted 17 years ago #


    I've had mine up almost a year ago. I forget so I've and started again on my test nightly install.

    Put the structuredblogging.php in mu-plugins.

    I removed line 25 in sb-post.php - require_once(dirname(__FILE__) . "/../wp-includes/template-functions-post.php");

    I haven't checked the other sb-*.php files.

    I've noticed the upload fields don't go to the right places(no paths to blog.dirs). It was simpler then to put in an enter URL field instead(copy/paste from ???). I don't miss it.

    It looks like there are differences in the version that I have running, and what I've just downloaded.

    Needs more, no doubt, but its running.

  14. dsader
    Posted 17 years ago #

    Oh, most importantly, I have the following in my htaccess
    RewriteRule ^([_0-9a-zA-Z-]+)/wpsb/(.*) /wpsb/$2 [L]

    The current plugin has a "wpsb-files" folder, though. But 'RewriteRule ^([_0-9a-zA-Z-]+)/wpsb-files/(.*) /wpsbfiles/$2 [L] doesn't work.

    I'm thinking I had to rename the folder to just "wpsb" then change the path in the rest of the plugin's files.

    Good luck.

  15. dsader
    Posted 17 years ago #

About this Topic

  • Started 17 years ago by nonrecursive
  • Latest reply from dsader