Monday 24 September, 2007

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!!


Related Posts


Dooodl 1.1 released
Dooodl 1.1 released
Download, Projects, Wordpress
Creating worlds
Creating worlds
Cinema4D, Download
Spread the word, an iPad app built in Flash!
Spread the word, an iPad app built in Flash!
Actionscript, Download, Experiments, Projects, Red5

43 Comments

  • 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.

  • Ronny says:

    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! :)

  • 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.

  • Ronny says:

    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.

  • 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.

  • 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.

  • Ronny says:

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

  • Dragon says:

    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

  • Ronny says:

    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!

  • kamal says:

    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

  • Ronny says:

    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.

  • kamal says:

    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

  • Ronny says:

    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. :)

  • kamal says:

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

  • Matt says:

    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

  • rolando says:

    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

  • Paul says:

    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…

  • David Rogers says:

    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

  • Alper says:

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

  • Alper says:

    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 ;) )..

  • Kaustubh says:

    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

  • Alper says:

    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

  • Azmeer says:

    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 ?

  • Azmeer says:

    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 ?

  • Elena says:

    Just what I needed! Thanks!
    Saved me a lot of time :-)

  • Christoph says:

    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/

  • Christoph says:

    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

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

  • Colin Wheeler says:

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

    Great work from all the contributers!

  • tom says:

    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?

  • Vimento says:

    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

  • Ronny says:

    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

  • Vimento says:

    Thats really cool :)

    Keep up the good work.

  • Robin says:

    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?

  • Ronny says:

    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!

  • 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

  • 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

  • Agadir says:

    hi,
    hop u contenue developing this amazing plugin!
    thanks


Trackbacks and Pingbacks

Leave a Comment


Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">