Inline Posts en Categorieën (Powered by Aral Balkan)

Ik heb onlangs een testproject gestart dat waarschijnlijk binnen enkele weken mijn nieuwe site moet gaan voorstellen. Hiervoor had ik een optie nodig waardoor ik een pagina kon aanmaken waar ik meerdere posts in kon samenrapen, door middel van een centrale ‘tag’ zeg maar.

Spontaan dacht ik aan categorieën, maar dan krijg je meteen die vervelende ‘/category/’ in je URL. Dat vond ik niet bepaald aantrekkelijk. Verder wou ik zelf ook nog wat tekst als inleiding op de inhoud erbij hebben. Dat kan je niet doen via de WP-Admin (wat voor mij juist belangrijk is om redenen als useability).

Ik ging dus op zoek naar een plugin voor WordPress (waar ik mijn project op baseer). Ik wist al van Aral Balkan’s plugin voor inline posts af, maar ik wist niet echt of dit mijn probleem uit de wereld kon helpen. Je raadt het al. Dat lukte niet hoe ik wou. Ik heb dan Aral’s plugin maar bijgewerkt zodat hij deed wat ik wou.

Het leuke is dat de plugin nog altijd zoals ervoor werkt, en hij nu ook categorieën kan includen in één en dezelfde post of pagina!
Alle gekheid op een stokje kan deze plugin nu de meest zeldzame combinaties in 1 post of pagina aan:

  • Meerdere posts in 1 post of pagina
  • Een categorie van posts in een post of pagina
  • Een post en een categorie van posts in een post of pagina
  • Meerdere categorieën in een posts of pagina
  • Zo kan ik wel nog even doorgaan 🙂

Thanks to Aral for providing me with the initial step I needed to make this work!

Download:

Klik hier!

Installatie:

  1. Upload het bestand InlinePostsAndCategories.php naar je wordpress/wp-content/plugins/ map
  2. Ga naar je plugin manager in je WordPress administratie en activeer de plugin.
  3. Klaar!

Gebruik:

  1. Include een post als volgt:
    Hier volgt een included post [[ 40 ]]
  2. Include een categorie als volgt:
    Hier volgt een included categorie [[ cat:14 ]]

In English for the non-Dutch people 🙂 :

Download:

Click here!

Installation:

  1. Upload the InlinePostsAndCategories.php file to your wordpress/wp-content/plugins/ folder.
  2. Go to the plugin manager in your WordPress administration and activate the plugin.
  3. You’re good to go!

Usage:

  1. Include a post:
    Here follows an included post! [[ 40 ]]
  2. Include a category:
    Here follows an included category! [[ cat:14 ]]

Veel plezier / Have fun!!

Ronny

view all posts

Ronny is a freelance frontend developer with a wild passion for creativity and a relentless hate against flat design. Ronny spent years as a Flash developer before moving to HTML5 and rediscovering fun and happiness.

43 Comments Join the Conversation →


  1. Mark Pagliaro

    The posting all of category works good. However the page I am using it with will only display’s the last 5 of the category can I change that to unlimited? As my intended use is to display all.

    Reply
  2. Ronny

    Sure you can. I haven’t tried with more than 3 posts so I can’t tell if it would work or not with more than 5 posts. Feel free to alter it, and let me know how it turned out. I will list it here as well! 🙂

    Reply
  3. Mark Pagliaro

    Where is the limit defined? I can’t seem to trace it. If you haven’t defined a limit I guess this is a perk I would have to live with and then post the rest of the Id’s Manually using the post functions. I tried other plug ins to increase the limits to no avail.

    Reply
  4. Ronny

    I am not really familiar with WordPress functions, but my best guess is that the getPostFromCategory() function is set to a max of 5 posts. I’ll look into it, and let you know what pops up.

    Reply
  5. Mark Pagliaro

    Well I am sort of on my way to getting this. Basically I have edited one line but it returns posts from every category. It does however return all posts.

    Reply
  6. Mark Pagliaro

    Well it turns out I did solve my problem it was a simple edit of

    (Previously)
    line 168 $allCatPosts=get_posts(‘category=’.$matches[0][$i]);

    (Edit to show all content in category)

    $allCatPosts=get_posts(‘numberposts=-1&category=’.$matches[0][$i]);

    Thank you for editing the intial inline posts plug-in as I doubt I would have been able to edit it myself.

    Reply
  7. Ronny

    Good job!
    I’ll post the update later on right here!
    Thanks for letting me know how you solved this.

    Reply
  8. Dragon

    Hey,

    Is het ook mogelijk om het automatisch de laatste 2 post te laten weergeven in een pagina?
    Voorbeeld:
    Ik heb een home en een subpagina. Op de home staat alleen een paar post. Maar op de subpagina (beheerd door author x) word alleen de laatste 2 post die door author x gepost zijn weergeven.

    Want ik heb verschillende subpagina’s en al deze pagina’s worden door verschillende authors beheerd. Vandaar dat ik dit vraag. Thnx

    Reply
  9. Ronny

    zou perfect mogelijk moeten zijn.
    Aarzel niet om zelf het PHP bestand te wijzigen naar je eigen wensen. Zolang je er de vermeldingen van Aral Balkan (de originele auteur van de plugin) en mij in laat zie ik alle wijzigingen tegemoet. Laat zeker even zien wat je ervan gemaakt hebt, ik zal er met veel plezier naar linken!

    Reply
  10. kamal

    thanks for providing the cat option,
    please how can i remove the title and (Last modified on 2008-12-02 13:53:13 GMT. 0 comments. Top.)
    thanks for help

    Reply
  11. Ronny

    I don’t excatly understand what you’re referring to. If you could show it to me on a screenshot, I’d be happy to help you out.

    Reply
  12. kamal

    Thanks for ur reply, this is the screenshot:
    http://img401.imageshack.us/my.php?image=screenxv5.jpg
    i’d like to remove the title and the info over the red frame.
    Thanks

    Reply
  13. Ronny

    If I had the time right now, I’ld look into it, but I’m afraid school is keeping me too busy right now.

    However solving this should be easy. Take a look in the PHP source. There are some lines dedicated to marking up this information. Just commenting them out should do the trick. 🙂

    Reply
  14. kamal

    i do removing some, but i have allways errors… so i hop u’ll be free, The school it’s the first.
    see you

    Reply
  15. Matt

    Ronny,

    Is there a way to limit the size of each post in the category once you use your tool? I was hoping that when using this tool that it would create a “continue reading” link for each of the posts in the category.

    Thanks for your help

    Reply
  16. rolando

    How do we make the “more” tag work here so you get the “read more” link? This works great, except I don’t want the entire post showing on that special page, only on the post/page itself. Thanks, Rolando

    Reply
  17. Paul

    Ey Ronny!
    Ten eerste even: super plugin! precies waar ik naar op zoek was:)

    Ik zit alleen nog even met een klein probleemje, de posts worden niet goed weergegeven. Wil graag het posts format gebruiken van mn .css file.

    Gaat om de margin-bottom(uit css file):
    .post {
    margin-bottom: 100px;
    font-size: 11px;
    }
    Enig idee hoe ik dit kan aanroepen/verwerken in de inlineposts.php file? Kan me niet voorstellen dat het heel moeilijk is, maar ik krijg het nog niet voor elkaar…

    Reply
  18. David Rogers

    I am stuck on how to exactly enter the code?

    I have tried the Brackets [[]]
    The only problem is that i am using SEF urls? ( So I can enter cat:2 )

    Can someone out there please show me exactly how the code looks when entering it on the page itself??

    Thanks

    David

    Reply
  19. Alper

    ARAL BALKAN+RONNY+MARK PAGLIARO = PERFECT 😉
    Thank you all…

    Reply
  20. Alper

    DAVID:
    try [[cat:2]] into HTML format because sometimes tags can be effect to defect codes.. And i think SEF url does not effect to Category IDs (Just idea ;))..

    Reply
  21. Kaustubh

    hey thanks a ton….
    can you tell me how to show only excerpts and not the complete posts using your pluggin.

    do i need to modify the code

    Reply
  22. Alper

    Hi all, actually i don’t now PHP enough, but i am trying to learn and i am using this plugin and i wanted to make it better, so i’ve complated first update (v 2.2.0), with this update you can localize Inline Post plugin and you can excerpt it (e.g. let only first 250 character will be seen for each posts) and you can define this value from Options page. But there is a little problem here: When you excerpt your posts (it does’t take title of posts into acoount) it cuts the code part, i mean for example your 195. character of post is <a href=”http:/….. then it cuts from f of href and <a hre will be seen in the end of your post.
    In Addition: When you excerpt your posts then an extra ‘See All…’ mesage will be shown with link to post…
    I wish you’ll like it.
    Best regards to All…

    link: http://www.anfyazilim.com/programlar/Inline Posts v2.2.0.zip

    Reply
  23. Azmeer

    Thank you for the plug-in. I just wondering how about giving the option to include a “” tag to separate the posts? Also this doesn’t process tag ?

    Reply
  24. Azmeer

    Thank you for the plug-in. I just wondering how about giving the option to include a "" tag to separate the posts? Also this doesn’t process tag ?

    Reply
  25. Elena

    Just what I needed! Thanks!
    Saved me a lot of time 🙂

    Reply
  26. Christoph

    We are using your plugin on our site and for some reason it only displays 5 posts even though there should be 11.
    Any idea what could be the reason for this?

    http://werktage.org/programm/vortraege/
    http://werktage.org/category/vortrag/

    Reply
  27. Christoph

    we had to drop the script, because we are a bit in a hurry. if you still should have an idea, we would be happy about a solution.

    cheers
    Christoph

    Reply
  28. Uncensored Newsgroups

    Thank you so much for editing Aral Balkan’s plugin.
    I’ve searched for ages to find a inline category plugin!!!

    Reply
  29. Colin Wheeler

    Thank you for this – took me over two hours to track this down!

    Great work from all the contributers!

    Reply
  30. tom

    I am entering the proper syntax and the proper category ID, but this is displaying posts from all categories, not just the one I specified. Any ideas what would cause that?

    Reply
  31. Vimento

    Hi there, am using permalinks so there wont be any numeric id’s how can i include the category id then … i have tried out with the name but no luck 🙁

    How can i forward

    Reply
  32. Ronny

    Hi Vimento!
    Yes, you will always have to use the ID’s. You can find the ID’s of a category in the WP-admin. The way I always did it is by going to the category-manager in the WP-admin. Then hover over a category-name. In the statusbar of your browser you’ll see the destination of that link. The category ID can be read from there. It’s a bit of a stupid thing, but it’s easy enough.
    http://shots.nocreativity.com/6b085072f157a5c2866688a6fb620234.jpg

    Reply
  33. Vimento

    Thats really cool 🙂

    Keep up the good work.

    Reply
  34. Robin

    Love the plug-in, with the category ability you’ve added it’s perfect for one of my clients. EXCEPT that the “read more” part doesn’t work. When I display a page with a category of posts, I want just the excerpts of each post to show, but it’s showing the entire post. That’s not going to work for us …

    Is there a work-around for this?

    Reply
  35. Ronny

    Hi Robin!
    I think you should easily be able to edit the plugin (it’s rather simple) and replace the full blogpost tag with the excerpt. Good luck!

    Reply
  36. Thomas Gam Nielsen

    Hi Ronny

    Perfect co-work between you and Aral! I will try to do, what Robin asks for, and I will let you know, if I manage to do so. Maybe we can make it as an option in the menu:

    > Show the post
    > or only show the excerpt

    // Thomas

    Reply
  37. Thomas Gam Nielsen

    Hi again Ronny. I know that changing a plugin is easy for an experienced developer such as you, but I’m still a newbie.

    I have made a change in line 110:

    $postBodyText = ”.format_to_post($post->post_excerpt).”;

    // post_excerpt instead of post_content

    It gives me a page, where only the title of the posts show up on the pages, where your plugin in running.

    I will read a more on the WordPress Codex and hopefully I will manage to make the change, where I only show the excerpts of the posts.

    All the best,

    Thomas

    Reply
  38. Agadir

    hi,
    hop u contenue developing this amazing plugin!
    thanks

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *