WPMU Asides

After quite a bit of debugging and hacking I have “asides” working in WPMU now. Hopefully I can publish a new release early next week , so send your patches to me at donncha @ linux.ie if you want them included.
I also noticed a spelling typo – edit your post.html and change {the_category seperator=", "} to {the_category separator=", "} – otherwise your category separator will be ignored!

Update – I created a Smarty plugin that checks the category array for “Asides”. This means you can have an asides-format post that’s also in your humour category. Wait for the new release of WPMU for the plugin!

If you want to update your install so you can post asides do the following:

Create a category called “Asides”.

Edit wp-inst/index.php and look for the following line:
$content .= $wpsmarty->fetch( 'post.html' );
Insert two lines before that one:

$category = get_the_category();
$wpsmarty->assign( “category”, $category[0]->cat_name );

Edit your post.html so it looks like this:

{the_date d=” before='<p class=”date”>’ after='</p>’}
{if $category != ‘Asides’}
{is_aside}
{if $is_aside == false}
…..
…..
most of the body of the comments template goes here.
…..
…..
{else}
<div class=”storyContent”><p>{get_the_content} {comments_popup_link zero='(0)’ one='(1)’ more='(%)’}</p></div>
{/if}

{link_pages before='<br />Pages: ‘ after='<br />’ next_or_number=’number’}

The code I added is in italics. Note that asides won’t be filtered by the automatic filters. Is there a way of getting the post content without “echo”ing it out? I need to replace the last </p> of the content because it pushes the comments link down way too much! That means returning it and feeding it into a Smarty modifier. (ie. {the_content|regex_replace:”/^<\/p>$/”:””} doesn’t work because nothing is returned.)
(If WordPress mangles the code above, take a look at my post.html for a clearer explanation.
(If you’re wondering, I’m using the “KDE About” star as an icon for aside entries.)

Leave a Reply

%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close