WordPress Asides, ColdForged-style

UPDATE: I’ve changed templates since this was written. This stuff is still effective, it’s just not displayed here.

As you can see, I’ve gotten my “asides” in place here. Note that you’ll have to go to the main page to see them. I used to maintain something I called the “sideblog” that was over in the sidebar and had links to things I found interesting but that didn’t merit a full post. I’ve missed my sideblog but have also been contemplating something more integral. Matt’s asides are more of what I had in mind as people are able to comment on his asides, but the thing that I don’t like about them is that his tend to gather up between posts, such that you often have to scroll down to get to the meat. I wanted my asides to be more “quick takes” that are almost ephemeral, they don’t take up a lot of room, and they’re definitely subservient to the main content (as rich as it is :D ).

The solution that I’ve come up with accomplishes my goals. Now I can post to a separate category cunningly called “Asides”. These posts are not included in the posts that are displayed on the main page, or in the “Last Five Entries” in the sidebar, or in the “More Recent Entries” at the bottom of the index. They appear in groups of 3 (if there are enough, a condition that only exists now as I haven’t generated 9 asides to fill all the spaces) between main posts. As I add asides, they redistribute themselves between the posts so that the 3 most recent appear at the top of the index, the next three appear between the first and second posts and so on. People can comment on these asides and see how many comments exist on the aside. Going to the comments also shows that you can view the archives of asides. There’s even an RSS feed for people that want to subscribe to the nutty asides.

So, how was this done?

Fairly straightforward but with some customization of plugins. I started off with Scott Reilly’s Customizable Post Listings plugin. This is a plugin that makes it pretty easy to generate lists of posts in various ways. However, it didn’t have quite the functionality that I needed for a couple of things — I wanted to replace my plugin with his, so I needed it to be able to do the things I needed for my “Last Five Entries”, my “More Recent Entries”, and my Asides. Here are the things I added:

Installing the plugin

Scott may work some of this functionality into his plugin, but until then those of you wishing to have similar functionality can use my version of his plugin. Install as usual — unzip, stick file in your wp-content/plugins directory, activate from the WordPress control panel. Now, to get the view count functionality — and bear in mind that this is optional… if you never use the view_count orderby list type or try to use the %post_view_count% format specifier you’ll never have problems — you’ll need to update the database. Run the following MySQL command against your database.

[code]ALTER TABLE wp_posts ADD post_view_count INT UNSIGNED NOT NULL[/code]

Now it’s up to you to decide how you want to have your posts tracked. Wherever you view a post you’re welcome to have that tracked… from within your index, from only the single post view page, it’s totally up to you. Insert the following code in the loop wherever you wish. The only requirement is that the global variable $post be available.

[code lang="php"][/code]

This simply increments the view count for the current post.

Getting a list of asides

An important note about asides. If you’re dealing with one category of exclusions, that’s pretty simple. WordPress supports one category of exclusions pretty handily with one simple change to the main index.php. Simply insert a line in the following location of the main index.php at your blog’s root. Note that it is the “$cat =…” line that we added.

[code lang="php"]/* Don't remove this line. */ $cat ="-27"; require('./wp-blog-header.php'); include(ABSPATH . '/wp-header.php');[/code]

That tells WordPress to leave out all posts in the category whose ID is 27 from the main processing loop. It’s only when you want more that one category excluded that you’ll have trouble. To do that you have to modify WP itself. It’s not hard, but some people may be skittish. First, change that line to be a space-delimited list of categories preceded with dashes that you want excluded, like so:

[code lang="php"]/* Don't remove this line. */ $cat ="-27 -28"; require('./wp-blog-header.php'); include(ABSPATH . '/wp-header.php');[/code]

Now, edit your $ROOT/wp-includes/classes.php.

You’re looking for the following code:

[code lang="php"]$q['cat'] = ''.urldecode($q['cat']).''; $q['cat'] = addslashes_gpc($q['cat']); if (stristr($q['cat'],'-')) { // Note: if we have a negative, we ignore all the positives. It must // always mean 'everything /except/ this one'. We should be able to do // multiple negatives but we don't $eq = '!='; $andor = 'AND'; $q['cat'] = explode('-',$q['cat']); $q['cat'] = intval($q['cat'][1]); } else { $eq = '='; $andor = 'OR'; } $join = " LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) "; $cat_array = explode(' ',$q['cat']); $whichcat .= ' AND (category_id '.$eq.' '.intval($cat_array[0]); $whichcat .= get_category_children($cat_array[0], ' '.$andor.' category_id '.$eq.' '); for ($i = 1; $i < (count($cat_array)); $i = $i + 1) { $whichcat .= ' '.$andor.' category_id '.$eq.' '.intval($cat_array[$i]); $whichcat .= get_category_children($cat_array[$i], ' '.$andor.' category_id '.$eq.' '); } $whichcat .= ')'; if ($eq == '!=') { $q['cat'] = '-'.$q['cat']; // Put back the knowledge that we are excluding a category. }[/code]

and we’re going to change it to this:

[code lang="php"]$q['cat'] = ''.urldecode($q['cat']).''; $q['cat'] = addslashes_gpc($q['cat']); if (stristr($q['cat'],'-')) { // Note: if we have a negative, we ignore all the positives. It must // always mean 'everything /except/ this one'. We should be able to do // multiple negatives but we don't $eq = '!='; $andor = 'AND'; } else { $eq = '='; $andor = 'OR'; } $join = " LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) "; $cat_array = explode(' ',$q['cat']); $whichcat .= ' AND (category_id '.$eq.' '.abs(intval($cat_array[0])); $whichcat .= get_category_children($cat_array[0], ' '.$andor.' category_id '.$eq.' '); for ($i = 1; $i < (count($cat_array)); $i = $i + 1) { $whichcat .= ' '.$andor.' category_id '.$eq.' '.abs(intval($cat_array[$i])); $whichcat .= get_category_children($cat_array[$i], ' '.$andor.' category_id '.$eq.' '); } $whichcat .= ')';[/code]

My asides are interspersed between main posts only on the index. Therefore, my list function invocation is in the main loop, right before any actual post output. Note that I keep track of the return value so as to be able to automatically increment through the asides. That way, for instance, if I ever choose to have a different number of posts on my front page the asides will be correctly handled as opposed to hard-coding any numbers in. The $asides_offset variable controls this and starts at zero before the invocation. Each time through the loop it is incremented by the number of posts actually processed and then passed as the offset parameter into the function. 27 is the category ID for my asides, so that is the only category I want in this list.

[code lang="php"]$asides_offset += c2c_get_recent_posts( 3, '

<

p>» %post_content% (%comments_count_url%)', '27', 'date','DESC',$asides_offset);[/code]

My “Currently Reading” section on the main page is a separate case but similar to an aside. It’s not included in the main flow of posts and not included in various lists, just like the asides. For completeness’ sake, here’s that invocation. Note that 28 is the category for “Currently Reading”.

[code lang="php"]c2c_get_recent_posts( '1',"

%post_content% (%comments_count_url%)

",'28');[/code]

Customizable “recent posts” lists

Now for the sidebar “Five Most Recent” and the index’s “More Recent Entries” the syntax is slightly different. Here’s both of those calls, with the exclusions needed to leave out the asides and “Currently Reading” stuff. First the “Five Most Recent”. The most interesting thing about this invocation is the multiple category exclusions (the ‘-27 -28′ to exclude category numbers 27 and 28):

[code lang="php"]c2c_get_recent_posts('5',"

  • %post_URL% %post_date%
  • ", '-27 -28','date','DESC',0,'F d,Y');[/code]

    Now for the slightly fancier “More Recent Entries”. Note that I’m excluding the same categories but using some different formatting options, all from one call. In this case I want to start my posts from the last post on the index, so I utilize the existing “$posts_per_page” variable which tells WP how many posts to display on the index. It handily doubles into the amount of posts to offset for the “Most Recent Entries”.

    [code lang="php"]$comment_icon = ''; c2c_get_recent_posts( 9, '

    %post_URL%<br />Posted on %post_date% in %post_categories_url% | '.$comment_icon.'  %comments_fancy_url%

    ', '-27 -28', 'date','DESC', $posts_per_page,'F d, Y' );[/code]

    The final invocation is for my “most viewed posts” list. The only thing different about this is the “order by” parameter. In this case I want to order by the “view_count” field in descending order, meaning that the most viewed post is listed first.

    [code lang="php"]%post_URL% %post_date%",'-27 -28','view_count','DESC',0,'F d,Y');?>[/code]

    Hope this helps someone. Note that this post has been around for about a week in various stages, but with the code section screwups it was too ugly to post. It still isn’t perfect, but it’s better than nothing.

    If you like it…

    Please note, if you find this or any of my plugins useful and feel the need to express your appreciation, I accept donations with a difference. Click the banner below to learn more.

    84 Responses to “WordPress Asides, ColdForged-style”

    1. 1

      ColdForged (971 comments) - November 5th, 2004

      Sigh Now if only someone could tell me how to get good <code> sections I’d be set. That’s the best I could manage though.

    2. 2

      Mike (37 comments) - November 16th, 2004

      Good code blocks are tough. It’s part of the reason I made my wordpress layout non-fixed. But also because I haven’t had any time to mess with my blog in ages. If you find any good code block code, I’ll probably steal it from ya. :)

      The asides are nice. I was kinda wondering what you had going there. At first I thought they might have been small tidbits related to the article before or after them but they didn’t make sense. :P

    3. 3

      ColdForged (971 comments) - November 16th, 2004

      Good code blocks are tough. It’s part of the reason I made my wordpress layout non-fixed. But also because I haven’t had any time to mess with my blog in ages. If you find any good code block code, I’ll probably steal it from ya.

      This is as close as I’ve come, and it’s still not quite perfect for some things. the php prefix (e.g. <?php) doesn’t take kindly to being in there and I have to diddle with the break tags (<br />) to get them to display instead of be acted upon. The only thing left is line wrapped to my maximum width. That’s trickier than it should be, since if I’m, for instance, in an inline comment and want to wrap the line I have to indent and start a new inline comment. Blech.

      The asides are nice. I was kinda wondering what you had going there. At first I thought they might have been small tidbits related to the article before or after them but they didn’t make sense.

      Thanks! Yeah, perhaps interspersed as they are they’re a bit confusing. I’m happy with them but am open to improvements or ideas for making them less confusing. Perhaps some “asides” designator would help.

    4. 4

      Silent Corner &raquo; Marvel On Crack - November 17th, 2004

      der: Gaming &#8212; Mike @ 1:16 pm I&#8217;m starting to think I need a version of ColdForged&#8217;s asides plugin&#8230; Am I the only one that& [...]

    5. 5

      Michael (3 comments) - December 7th, 2004

      I’m no programmer, but after about two hours of trial and error I got this to work under Kubrick 1.2.6 Thank you. The only problem I have found is that placing $cat=”-27″; in the specified line tosses out the setting for number of posts to show on the main page. I have put it in an taken it out. Sure enough the minute I put it in every post I have ever made gets called when you hit my main page. I am new to blogging so it is only 30 or so – but any idea on how to correct this. Everything else is per you spec.

      Thanks so much!

    6. 6

      ColdForged (971 comments) - December 7th, 2004

      I’m no programmer, but after about two hours of trial and error I got this to work under Kubrick 1.2.6 Thank you.

      Excellent, glad you found it useful!

      The only problem I have found is that placing $cat=”-27”; in the specified line tosses out the setting for number of posts to show on the main page.

      I went ahead and answered this on the Flickr page.

    7. 7

      AdamStac (42 comments) - December 13th, 2004

      Thanks ColdForged..I got this set up. I didn’t use the asides (yet), or More Recent Entries, but I used some other abilities of the plug-in. Thanks for the detailed walk-through! Very cool of you.

      Keep them coming…

    8. 8

      Jamin (1 comments) - December 19th, 2004

      Hi. I’m trying to get this working, but get the following error on the top of my index page:

      WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' 3' at line 1] SELECT DISTINCT * FROM wp_posts LEFT JOIN wp_post2cat ON (wp_posts.ID = wp_post2cat.post_id) WHERE wp_posts.post_date <= ’2004-12-19 17:29:39′ AND ( wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘sticky’ ) AND wp_posts.post_password = ” AND (category_id = 15)GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT , 3

      Then these lines inbetween posts:

      » $asides_offset += c2c_get_recent_posts( 3, ‘

      » %post_content% (%comments_count_url%)’, ‘27′, ‘date’,’DESC’,$asides_offset);

      As of now you can see the error for yourself on dcoi.endopsychosin.com. Any help would be appreciated, if you can find the time.

    9. 9

      Beetle Blog » Reading List Implementation - February 25th, 2005

      [...] Reading List ImplementationThursday, Feb 24 2005  BloggingBrentlate evening ColdForged details how to use his version of Scott Reilly’ [...]

    10. 10

      trench (6 comments) - March 1st, 2005

      ColdForged, can you tell me what this actually does? Where did you stick this (<?php c2c_increment_post_view_count();?>) in your loop? Im getting all kinds of parse errors. I really want the asides menu you have. Thats what Im trying to accomplish here.

    11. 11

      ColdForged (971 comments) - March 1st, 2005

      You don’t actually need that post view count stuff if you’re just after the asides. The only things you really need to do are:

      1. Install the plugin. (Note that there’s a newer version available than is listed here. Try this one).
      2. Do the stuff with the category exclusion thing in index.php.
      3. Do the “c2c_get_recent_posts” for the asides in an asides type of div in your theme’s main template.

      If you’re really lost, have a look at my main template and see if it helps any.

    12. 12

      trench (6 comments) - March 2nd, 2005

      Thanks very much. going to look into this more.

    13. 13

      coldforged.org » Blog Archive » “Where the hell are my comments?” - March 3rd, 2005

      [...] siding in the database. They weren’t displayed in my blog—though my customized asides plugin didn’t handle them perfectly and my comment [...]

    14. 14

      Kevin (8 comments) - March 3rd, 2005

      I get the following error in the most recent entries listing:

      WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1] SELECT category_nicename FROM wp_categories WHERE cat_ID=

      How might I go about fixing that?

    15. 15

      ColdForged (971 comments) - March 4th, 2005

      Kevin, is it possible that you have a post that doesn’t have a category?

    16. 16

      Kevin (8 comments) - March 4th, 2005

      All entries belong to at least one category, and that would be General if nothing else.

    17. 17

      ColdForged (971 comments) - March 4th, 2005

      All entries belong to at least one category, and that would be General if nothing else.

      Ah, dammit, I was pointing to the wrong version of the plugin in the post, and it only bit 1.5 people. There was a function prototype — get_category_link() for those interested — that changed between 1.2 and 1.5. Re-download the plugin from the link given (or here) and try again.

      Sorry to temporarily diddle you :( .

    18. 18

      Kevin (8 comments) - March 4th, 2005

      No problem at all. Thank you! :-)

    19. 19

      chenu (4 comments) - March 5th, 2005

      I’m interested in implementing your system of Asides because, I don’t want the asides to be counted as a main post on the index page.

      What can I do to make 2 asides appear after posts and have them auto increment. When I use the code from the plugin, the posts do not auto increment.

      My index file is located here.

    20. 20

      ColdForged (971 comments) - March 5th, 2005

      chenu, take a look at my index and look for the text asides_offset. That’s the secret :) .

    21. 21

      chenu (4 comments) - March 5th, 2005

      Hmm, you don’t seem to have linked to your index file. You just have empty a tags.

    22. 22

      ColdForged (971 comments) - March 5th, 2005

      Oops. You mean this index?

    23. 23

      chenu (4 comments) - March 5th, 2005

      Thanks a lot, I got it figured out almost completely. The only thing I need to do now is to add the line that I have under all posts under the asides. How would I add it so that it is only included once under each asides block.

    24. 24

      chenu (4 comments) - March 5th, 2005

      Actually, I figured it out, I just put 2 instances of %post_content% (%comments_count_url%)', '19','date','DESC',$asides_offset);?> one without the line code and one with.

    25. 25

      Derek (4 comments) - March 9th, 2005

      I’m using a modified Kubrick theme, and for some reason it’s putting a line break between each of the percent tags. Why would it be doing that?

    26. 26

      ColdForged (971 comments) - March 10th, 2005

      Derek, try putting the content that you want for your asides in the excerpt and displaying the_excerpt instead of the_content. This has to do with the way WP styles the_content.

    27. 27

      Derek (4 comments) - March 11th, 2005

      I’m pretty new at this. Can you please explain how I can do that? Sorry, I’m just figuring PHP and WP out.

    28. 28

      ColdForged (971 comments) - March 11th, 2005

      Can you please explain how I can do that?

      Sure. First, go to the Options -> Writing page and look for the “When starting a post, show:” setting under “Writing Options” and set your editing mode to the “Advanced controls.” This will allow you to see the excerpt field. Now, go back and edit your asides posts and cut the content that you had in the big text area (the “Post” section) and paste it into the “Excerpt” area, then save.

      Now, go to your template editor and edit the Main Template. Find where you put the asides code and change the '%post_content%' to be '%post_excerpt%' instead. Save the template. Now you should be good to go!

    29. 29

      Ashwin (4 comments) - March 16th, 2005

      I’ve been meaning to implement something like this on my website for a long time but never really found the time or the plugin that did it for me. Gotta thank you for doing all the hardwork for me. :)

      I implemented all but your “Recent Entries” on my site without much hassle. Thanks once again.

    30. 30

      ColdForged (971 comments) - March 16th, 2005

      Glad it was helpful, Ashwin, nice work.

    31. 31

      Ashwin (4 comments) - March 17th, 2005

      OK..ran into a small problem and hope you can help me fix it. Until today I had less than or equal to 3 entries for the Asides and things looked great. I added the 4th entry today and it was supposed to move the oldest entry below the first post like on your site.

      However, things look good on IE, the two Asides boxes are book-ending the first post like they should, but on Firefox the DIV for the Asides is overlapping the first post.

      I’ve checked the the correct DIV’s are closing in the right locations but still can’t get this to look properly in Firefox, any help you could lend would be much appreciated.

      Regards

    32. 32

      ColdForged (971 comments) - March 17th, 2005

      My first recommendation is, as always when dealing with things like this, make your page validate. When faced with weird behavior, get your page to be valid XHTML first and quite often the rest will follow.

      Good luck.

    33. 33

      Ashwin (4 comments) - March 17th, 2005

      Very good advise. I went ahead and made the XHTML valid and IE still continues to work, while Firefox is stumbling.

      I realize this has probably nothing to do with your plugin, but any other advise you have would be appreciated.

      Thanks

    34. 34

      ColdForged (971 comments) - March 17th, 2005

      You are floating your .post selector left. Remove the float: left; command from that selector and I think you’ll be where you want to be.

    35. 35

      Ashwin (4 comments) - March 17th, 2005

      Thank you very much! That was indeed the problem, I was playing around with it quite a lot and even considering switching the theme just to make this work. But I’m all set now. SWEEEET! :)

    36. 36

      Derek (4 comments) - March 17th, 2005

      I’m back. I’ve looked at my code, and I didn’t have %post_content% in there at all, just %post_excerpt%. What should I check now?

    37. 37

      ColdForged (971 comments) - March 17th, 2005

      What is the exact format string you’re passing to the function?

    38. 38

      Derek (4 comments) - March 17th, 2005

      Is this what you mean?

      %post_title%%post_excerpt%(%comments_count%)’, ’18′);?>

    39. 39

      AdamStac (42 comments) - March 20th, 2005

      Just thought that I’d tell you that you are the MAN! Great tweak and great instructions…nice!

    40. 40

      cat (27 comments) - March 27th, 2005

      hmm.. i actually got this one to work. yay, me! out of curiosity, how did you get the image to show up for the “currently reading” aside in the sidebar? i can’t get my image to show up.

    41. 41

      Denis de Bernardy (2 comments) - March 29th, 2005

      Coldforged,

      Just curious, did you find a solution to your code block problem?

      If not, suggestion:

      set $max_code_line_length

      filter code blocks, line by line for each line that is too long, do truncate procedure

      truncate at last code keyword before 40 chars e.g. in: [some long condition...] && ( cond1 || cond2 ) truncate before ‘&&’ or ‘(‘ or… etc but not before or in the middle of ‘cond1′

      make it clear the indented line is tabbed

      might work (but might make VB code confusing)

    42. 42

      MrHappyGoLucky (28 comments) - April 1st, 2005

      Hrm. I’m very interested in this plugin, but for some reason my asides are still showing up as main posts and I’ve got a few empty aside blocks under some posts.

      Confused!

      My index is here

      Lil’ help?

    43. 43

      MrHappyGoLucky (28 comments) - April 1st, 2005

      Oh, and the hyperlinks aren’t working.

    44. 44

      ColdForged (971 comments) - April 1st, 2005

      I’m very interested in this plugin, but for some reason my asides are still showing up as main posts

      Note that the category exclusion has to go in the main index.php in your blog root, not the theme one. It’ll go right before the require('./wp-blog-header.php'); line.

      I’ve got a few empty aside blocks under some posts.

      That will happen until you have enough asides to fill in all of them. My best suggestion if it bugs you would be to either whip out some serious asides or reduce the number of posts displayed on the main page until you fill them out.

      Oh, and the hyperlinks aren’t working.

      Don’t know what you mean there.

    45. 45

      MrHappyGoLucky (28 comments) - April 2nd, 2005

      Doh, that fixed it right up. As far as filling up the asides, that’s no problem at all. I love those little fellas.

      On the hyperlinks thing, what I was referring to is that if I link to something in an aside, the link won’t show up for some reason. You have to click on (more) to go to the actual post and then click the link.

      I’m sure it’s something having to do with the excerpt feature or something, but I can’t seem to figure it out.

      Thanks for the help!

    46. 46

      MrHappyGoLucky (28 comments) - April 3rd, 2005

      Just a follow up. Coldforged help me figure out what was wrong with my hyperlinks not functioning. I was putting my asides in the Content section of the post instead of Excerpt.

      Had I fully read the comments (I thought I did!) I would have seen this answered in comment #26. Doh!

      So to recap: Be sure to post your asides in the Excerpt section of your post, not the Content section and the category exclusion codes goes in your ROOT/index.php, not your template index.php.

      Thanks again CF.

    47. 47

      The Life of Me. » Archives » Spaghetti & Spam - April 10th, 2005

      [...] ebar. Try saying that three times fast! I have been using, yet another ColdForged plug-in, Customizable Post Listings for quite sometime now, but I’v [...]

    48. 48

      April (4 comments) - April 10th, 2005

      I tried adding the $cat =”-27″; to my index.php file, but it shows up in writting on the corner of my page. I put it exactly where you said to put it too. I also downloaded your plug-in, and for some reason it’s still not working. Hmph. I’m not a programmer, but I’m quick to learn.

    49. 49

      ColdForged (971 comments) - April 11th, 2005

      If it’s showing as text you didn’t put it in the right place. Here’s the entirety of my index.php. Note that this is the index.php that exists in your blog root, not in the theme directory.

      <?php
      /* Short and sweet */
      define('WP_USE_THEMES', true);
      $cat ="-27 -28";
      require('./wp-blog-header.php');
      ?>

    50. 50

      Beetle Blog » Blog Archive » Reading List Implementation - April 13th, 2005

      [...] dpress Include Page Plugin »

              Reading List Implementation
      
      
                  ColdForged details how to use his version of Scott Reilly&#8217; [...]
      
    51. 51

      The RummandDan show » Blog Archive » Another way to implement “Asides” - April 21st, 2005

      [...] was that i didnt wanted it to integrate into the frontpage of my blog posts, much like the coldforged style… I have recently published my movie coll [...]

    52. 52

      coldforged.org » Blog Archive » I hereby give up - April 22nd, 2005

      [...] but we don’t : -( Maybe it was the sad-face smiley that did it, I don’t know. I’ve had a hack for multiple exclusions that I use on this site because I n [...]

    53. 53

      Rgalgon (6 comments) - April 25th, 2005

      The asides block always displays at the top of the page no matter how I change time stamps or post afterwards. … < ?php if (have_posts()) : ?> < ?php $asides_offset = 0;?> < ?php while (have_posts()) : the_post(); ?> < div class=”asides”> < ?php $asides_offset += c2c_get_recent_posts( 3, ‘

      <

      p>» %post_content% (%comments_count_url%)’, ’6′, ‘date’,'DESC’,$asides_offset); ?> < /div> < div class=”post”> …..

      besides that everything is working great thanks for the guide

    54. 54

      ColdForged (971 comments) - April 25th, 2005

      Yes, that’s the intent of my design, Rgalgon. They are explicitly written to appear in a static place in my content instead of intermingled with the real posts.

    55. 55

      Rgalgon (6 comments) - April 25th, 2005

      ah, ok then, thnks for the quick reply

    56. 56

      Rgalgon (6 comments) - April 25th, 2005

      Me again, how then would I go about getting them at the top of each post like on your main page? Because where they are in the loop the div tag appears at the top of each post.

    57. 57

      ColdForged (971 comments) - April 25th, 2005

      Looks like you’ve already got them there, unless I’m misunderstanding your question.

    58. 58

      Rgalgon (6 comments) - April 25th, 2005

      Sorry for not being more clear. When I make new posts in the asides category how would I go about getting them to appear above different posts. Ideally I would like every ‘aside’ from when the last post was made to show up above that post, and then on a new post have a new asides section that begins to be populated by all new aside posts. For example on your main page right now in the first aside you have the frisking penguins, immensly funny book quote, etc. followed by your latest post, and then below that another asides section with different asides. How do you have different asides in different boxes? Is it based soley on timestamp of the aside posting in relationship to the post?

    59. 59

      ColdForged (971 comments) - April 25th, 2005

      The way I have my index set up, I have a static asides section between each “real post” that has 3 asides in it. As I post more asides, they simply flow between those sections. In other words, the three most recent asides always appear in the first section, the next 3 appear between the first two posts, etc.

    60. 60

      Rgalgon (6 comments) - April 25th, 2005

      ah, makes perfect sense now.

    61. 61

      Pau (1 comments) - April 30th, 2005

      I can’t seem to get the post view count to work in my blog. Can you give me a sample code which shows where and how to properly place this line?

      < ?php c2c_post_view_count(); ? >

    62. 62

      ColdForged (971 comments) - May 2nd, 2005

      Pau asked: Can you give me a sample code which shows where and how to properly place this line?

      You can see it in my single.php source file.

    63. 63

      Steve P. Sharpe | Thoughts and Examples of my Work » Blog Archive » Side Salad - New Feature - May 9th, 2005

      [...] here is also an RSS Feed for all “Side Salad” entries. Update: I am now using WordPress Asides Coldforged Style. It is a fully customizable p [...]

    64. 64

      Steve P. Sharpe (3 comments) - May 9th, 2005

      I can’t get the < ?php c2c_post_view_count(); ? > to work – I have viewed your single page but can’t see it. Am I missing something lol?

    65. 65

      Joen (1 comments) - May 9th, 2005

      This is a bloody fantastic plugin! It’s cleaned up so much cruft in my theme files. My thanks to you sir.

      As an addition (I couldn’t find it in this article), based on your own suggestion, separating out “Asides” from you main XML Feed is easy as well. The difficult part is to not filter them out if the feed is for a category. Why? Because providing an “Asides only” Feed is as simple as linking to the category feed. Or at least, if you use the following code right at the top of your wp-rss2.php (or whichever flavor XML you prefer):

      if (!empty($_GET['category_name'])) {
          $cat ="-28";
        }

      … where 28 is the Asides category ID.

    66. 66

      ColdForged (971 comments) - May 10th, 2005

      Steve asked: I can’t get the < ?php c2c_post_view_count(); ? > to work – I have viewed your single page but can’t see it. Am I missing something lol?

      Please note that it’s actually

      <?php c2c_increment_post_view_count();?>

      Try searching for that. Note also that you will have to modify your database as described in the post.

    67. 67

      Steve P. Sharpe (3 comments) - May 10th, 2005

      I want to actually show the post count on my single.php, I already have that line of PHP to increase the post count.

    68. 68

      ColdForged (971 comments) - May 10th, 2005

      Aw hell, that’s cake if you already have post counts increasing :) .

      <?php echo $post->post_view_count;?>

    69. 69

      Steve P. Sharpe (3 comments) - May 10th, 2005

      Lol. Yes it was cake =] – Silly question!

    70. 70

      noscope | Nocturnal Fauna - May 12th, 2005

      [...] n box Entry and comments have been separated further. Sidenotes are now simpler Powered by WordPress Asides, Coldforged Style (Thanks Steve), I’ve be [...]

    71. 71

      Subaqua Sternal Rubs - May 21st, 2005

      Asides Implemented

      As you may have noticed, I have implemented an asides feature, courtesy of ColdForged’s instructions, in the sidebar. Basically these are short news items/links of interest that don’t merit their own post. These asides are not syndicated in the mai…

    72. 72

      Subaqua Sternal Rubs » Blog Archive » Asides Implemented - May 21st, 2005

      [...] ented As you may have noticed, I have implemented an asides feature, courtesy of ColdForged’s instructions, in the sidebar. Basically these are [...]

    73. 73

      The Life of Me. » Archives » A SideBlog Defined - May 29th, 2005

      [...] you’re going to need: A text editor – I recommend Crimson Editor My version, of CF’s version, of Scott Reilly’s Customizable Post Listin [...]

    74. 74

      David (6 comments) - June 18th, 2005

      My asides are showing up fine, but I’m getting the following error:

      WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' 3' at line 1] SELECT DISTINCT * FROM wpposts LEFT JOIN wppost2cat ON (wpposts.ID = wppost2cat.postid) WHERE wpposts.postdate <= ’2005-06-18 16:41:49′ AND ( wpposts.poststatus = ‘publish’ OR wpposts.poststatus = ‘sticky’ ) AND wpposts.postpassword = ” AND (categoryid = 12)GROUP BY wpposts.ID ORDER BY wpposts.post_date DESC LIMIT , 3

      PHP and MySQL not really my strong point – any help appreciated! Running MySQL ver 4.0.24, and category 12 is my asides category.

    75. 75

      David (6 comments) - June 18th, 2005

      Scratch that last comment – I had a look at your index, changed my code et voila – problem solved! Thanks for such a great plugin!

    76. 76

      Firman Pribadi - June 23rd, 2005

      Not Really WordPress Asides

      Hey, take a look at main diary page. I just implementing another asides style. Code is taken from this page at WordPress Wiki which is originally published by Matt. However, it&#8217;s not really asides. I&#8217;ve modified Matt&#8217;s code to meet …

    77. 77

      15june.com - July 14th, 2005

      Modifying Post

      I have been planning to have aside category in my blog, until today when I finally managed to conquer my moodiness. Using Customizable Post Listings, so that it will look like the one utilized by Matt Mullenweg but all look the same, both of them are c…

    78. 78

      rudeboy (1 comments) - July 20th, 2005

      is there any way to not have it post the same aside before/after every post? i’d really like to impliment this, but my first “test” aside post is displayed between every post on the main page. it’d be a lot better if, should i have it set to display asides in groups of three ala your example, it would only display one block at a time until it’s full before making a second.

      what i mean is that if i only have one aside listing, only one aside is shown at the bottom of the first post rather than at the bottom of every post on the page. when a second aside is added it also gets added to the first aside area, then a third filling the first area. when the fourth is added the plugin only then makes the second aside area below the second post containg a single aside. this function might be in there somewhere, but i wasn’t able to find it…

    79. 79

      ColdForged (971 comments) - July 20th, 2005

      rudeboy said: Is there any way to not have it post the same aside before/after every post? i’d really like to impliment this, but my first “test” aside post is displayed between every post on the main page.

      There must be, that’s the way mine are :) . It sounds to me like you have the line $asides_offset = 0; inside the loop of your posts. Move that line outside The Loop. Here’s where I define it in my template:

      [code lang="php"] < ?php if (have_posts()) : ?> < ?php $asides_offset = 0;?> < ?php while (have_posts()) : the_post(); ?>[/code]

      Note that the declaration of $asides_offset is outside the while() loop.

    80. 80

      William (8 comments) - October 14th, 2005

      I get the following error in the most recent entries listing:

      WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1] SELECT categorynicename FROM wpcategories WHERE cat_ID=

      How to fix that ?

    81. 81

      jakob (2 comments) - December 5th, 2005

      Thank you very much for this great plugin/ -addition. the category exclusion works like a charm.

      i got only one problem: %postcategoryurl% always links to ‘$cat= ‘ the number for the actual category is missing and you got redirected to the startpage. any ideas, whats happening? my programming skills are next to non-existent and i cant find a soultion, sorry to bother you with this.

    82. 82

      Jimmy (2 comments) - December 17th, 2005

      Thanks! This is just what I been searching for!

    83. 83

      BUZZURRO - December 27th, 2005

      Asides

      That&#8217;s how these little notes up here are called. I implemented them following the instructions given by ColdForged, who I thank very much.
      

    84. 84

      Electric Venom » Blog Archive » We’re Having Some Fun Now - February 2nd, 2006

      [...] Best of all, I’m now using Coldforged-style “Asides” — you’ll find them on the main page in the little boxes. They’re ideal for those one-liners that don’t merit a full blog post. Often, that’s all I have time for — or can come up with — so having “Asides” means I’m likely to update the page far more often. Since you can leave comments on the Asides as well as on the entries, I hope they’ll help increase the site’s interactivity. [...]