CompositePost WordPress Plugin

This is a rewrite of a plugin I wrote some time ago.

It let’s you write posts and pages composed of other posts and pages.

IMPORTANT: IF YOU DOWNLOADED THE PLUGIN FROM WORDPRESS.ORG, PLEASE RATE IT (USE THE STARS). THANKS.

Usage

Write anywhere on a post:

[composite option=”value”]

You can specify one or more options. The options are the same used in the get_posts() function (see http://codex.wordpress.org/Template_Tags/get_posts).

Example

Show all posts from category Projects and include post with ID = 1:

[composite category_name=”Projects” include=”1″]

Templates

CompositePost create a loop using a template located in the plugin’s folder (usually /wordpress/wp-content/plugins/composite_post). The default template is /wordpress/wp-content/plugins/compositepost/default.php. You can have as many templates as you want, just specify wich one to use, like this:

[composite category_name=”Projects” template=”my_template”]

CompositePost will look for the file at /wordpress/wp-content/plugins/compositepost/my_template.php

Download

Download the plugin

Versions and Bug Fixes

0.3 – Fixed: missing post’s original content, not showing up.

0.2 – Fixed: for the <!–more–> quicktag.

0.1 – First version .

Advertisements

50 Responses to CompositePost WordPress Plugin

  1. Steveb says:

    Nice plugin! Seems to work quite well and is easy to use. However, it seems to ignore the <!–more–> quicktag when displaying a post on a designated page.

  2. Steveb says:

    Ok , I have figured out how to override the default behaviour; its a simple mod to CompositePost.php”.
    Read the wordpress codex on “the_content” and it explains how to override archive/single page behaviour.

  3. harrison says:

    My theme is modified to remove all the post meta information, but it still shows when I bring the post in using this widget. What would I need to edit to strip all this info and only leave the post title and date? I also show two “edit” links.

    • rutkoski says:

      The plugin does not use any templates from your theme. It has its own template, located in the plugin’s folder. You should take a look at this template file and modify it to match your theme. Let me know if it works.

  4. Mikey Leung says:

    Thanks very much for this plugin! I just wanted to note for other users that the plugin doesn’t need more modification in order to use content before the quicktag — thanks for fixing this up.

    I have another question though. The issue is I’m trying to display page content plus post content on the same page.

    After activating your plugin I see that it replaces my page content with post content completely.

    What would I need to change in order to have the page content be editable through the tinyMCE and then display the post content afterwards?

    Is that a limitation of the coding?

  5. Mikey Leung says:

    Sorry I didn’t explain it very well.

    Okay.. so here’s what happened when I used your plugin on a page of mine:

    http://panigram.dreamhosters.com/test-page/

    I put the following into the page’s content:


    Test page. Here is the content I want to stay on the page. I will place the composite post text below.

    [composite category=”news”]

    As you can see there is actually some test text above the quicktag that is no longer visible on the page itself.

    So my impression is that the call to the database is replacing the content of the loop with the posts and ignoring the original loop that would display the page content, not ‘adding to the content’ but in fact replacing it.

    Sorry, I’m not a very technical person and I hope I’ve been more clear this time around.

    My objective here is to display posts from a certain category on a page along with the page’s content. But in fact I am just getting the posts only…

    thanks for your help!

  6. missdemilo says:

    Hi there,

    First off – thank you for this plug-in! It works great.

    I am having the same issue as Mikey is having. I would like the page content to display and the post content to show-up underneath. But only the post content is showing-up.

    I wonder if this is an issue with WordPress 2.7?

    You can see my sample page here as well:
    http://missdemilo.com/wordpress/forms/

    I have put the blog posts into an accordian so don’t be confused by the way the information is being displayed. But above the accordian content/blog posts, I want the content for the “forms” page to display.

    Not sure if we’re just out of luck on this one since this is a new version of WordPress?

    Thank you!

  7. baron says:

    Works great, thank you

  8. joe says:

    brand new to word press. can anyone put up an example as to how to use this plugin? as in where do I put what info and where do I find this info to put into the page?

    • rutkoski says:

      Hi. The above post pretty much explains everything you need to know. Just write the plugin tag ([composite …]) with options anywhere on a post and you got yourself a composite post!

  9. mikeyleung says:

    Thank you! my issue is resolved now. I have rated the plugin at the wordpress site as well.. I recommend you start adding some documentation as it seems to be working better now.

    I’m now heading off to start changing the template around a bit..

  10. mikeyleung says:

    Fantastic, everything is working well now—thanks for the development of this plugin and I’m sure I won’t be the only one using this plugin.

    I suggest you google inline post plugin and start populating those pages with links back here — your plugin is 1000x better.

  11. Mich says:

    Hi there, excellent plug-in! It’s nice to see that someone has taken the time to enhance the inline posts feature.

    I am using a custom theme ‘Thesis’.

    Could this be the reason as the following is not taking affect on page?


    testing inline/composite posts

    [composite category=”Editorials”]

    It’s not filtering the category as specified. I ahve also tried for testing purposes, filtering a specific post and it is not taking affect.

    Any help is GREATLY appreciated.

    Here is link to view –>
    http://lowdownonline.com/testing-inlinecomposite-posts/

  12. Mich says:

    Hi there, i have resolved my problems and plugin is now fully functional! Thank you again, great work.

    1 problem i am currently experiencing is when i comment on the last post of the category being posted on a page, the comment also gets added to the page listing the category…

    Odd.

  13. Hi there,
    I have a question concering pagination.

    Is there a way to specify how many posts get posted per page with inline posts and then tell it to go to next page where the next page would display POSTS only from that specific category?

    Any help is greatly appreciated. Thanks in advance.

  14. Rachel says:

    THANK YOU! I’ve been using Aral’s plug-in but have been very frustrated because I couldn’t get the more tag to work no matter how much research I spent on it (I don’t have the technical know-how to really figure this out). Aral seems to be ignoring the comments… But I stumbled on your comment over there, and thought it’s worth checking out. And it works! I’ll be making a few modifications to the default.php file to make things look more like I want them but, ah, it’s such a relief! Finally!

    A couple of things I’d add if/when you modify it: First, add something that displays a little spiel at the bottom of the page to give you credit! I’ve been looking all over the place for a plugin that displays posts on a page AND uses the more tag. Had I seen that on a blog, I’d immediately installed it on mine… (I have added a footnote to my page to give you credit).

    Second, could you add a table of contents functionality like in Aral’s plugin? I really don’t like asking for something like this because I feel like I should be able to do it myself and then say “hi, I improved your great plugin” but I have no clue about PHP, so I am hoping you might find a TOC useful, too.

    Now I have to go give you some stars (oh, you might want to link to the download page to make that easier…).

  15. Rachel says:

    Sorry to bug you again… For some reason the result of “comments_popup_link” isn’t displaying – I am allowing comments both on the page and on the posts included… Any ideas?

  16. Danny says:

    Hi there

    Does this plugin allows me to have pagination on my gallery page and not just the homepage? If so, then how would that look like in the admin panel, if I wanted to make a post on the gallery page?

    Many thanks in advance
    CHEERS 🙂

    • rutkoski says:

      Sorry for not answering the comments sooner. I had a look into the pagination request, but I haven’t figured out how to do it. I’ll look more into that and get back at you guys.

      • Mikey Leung says:

        Also wondering about that pagination request as well. How do we control the number of posts displayed per page.. and have it paginate as well?

      • Robbi says:

        Hi – I’ve looked everywhere for something like this and it works great (so – THANK YOU!) but I’m also interested in pagination. My category is going to fill up quickly and I’d like a way for people to navigate backwards without going to the individual posts.

      • benj0s says:

        I think I may have a solution to your pagination request. I was required to get a composite post page paginated using wp-pagenavi and after many hours of head scratching I came up with the following solution which seems to work.

        In CompositePost.php at line 55 add:

        if(empty($r[‘paged’])) {
        $r[‘paged’] = get_query_var(‘paged’);
        }

        then at line 89 add:

        global $wp_query;
        $wp_query = $get_posts;

        Hopefully with these changes pagination should work for the plugin (using wp-pagenavi).

  17. Hawks says:

    Hi,

    I started using the Inline Posts plugin for my blog, but it is unfortunately lacking in some ways, so I thought I’d try out this one.
    The problem is, I’m very new to this and I don’t really know any PHP, and I don’t really understand how to make this plugin work.

    If anyone could be bothered to give me a step-by-step guide on how to make this plugin work, I would be immensely grateful.

  18. R says:

    Is there any way to include the latest blog posts – so get them by date posted, rather than by category?

  19. R says:

    You can control how many posts you get on the page by changing:

    include=”1″

    to numberposts=”x”

    Where x is the amount of posts you want, most recent first.

  20. R says:

    To answer my own question, you can get the last x amount of posts, regardless of category, by just putting:

    [composite numberposts=”x”]

  21. Esse plugin é um milagre! Exatamente o que estava precisando para meu site 🙂
    Mas Rodrigo, não conheço de php e não consegui localizar o fator limitante: eu peço para o plugin pegar todos os posts com a categoria “portfolio” [composite category_name=”portfolio”], mas ele só pega no máximo 2 posts. Eu gostaria que não tivesse limite porque estou construindo a página com diversos projetos.
    Qualquer ajuda sua nesse sentido seria ótimo!

    Abraço!

  22. sherdan says:

    Thank you for your great plugin.
    I use it to composite posts by tag.
    Is there a way to use (*)?
    I mean: if tags I need to use are, for example, North America, South America, United States of America, may I use:
    [composite tag=”*america*”]
    or whatever is useful to get all posts with “america” within tag?

    Thank you for your help.

  23. sherdan says:

    Hello, congratulation for this useful plugin.
    Is there a way to assign wildcard? I mean, a way to use [composite tag=”*america*”] in order to get all post which tag contains the word america (like united states of america, north america, south american and so on).

    Thank you! Have a nice day

  24. Andrew says:

    Any updates on pagination? I’d really love that feature… thanks!

  25. David says:

    Thanks for the plugin, it’s great.

    I can’t get the page i’m using composite post on to validate. A tag is being added before the post. Do you know how I can stop this?

    Cheers

  26. David says:

    sorry that should be a p tag

  27. brandon says:

    Hi,
    I’m trying out the compositepost plugin, but for some reason it only displays the most recent posts, not a specific post with a specific ID. I’m using WP 2.92 and the following syntax, trying to get it to insert only the post with ID=13
    [composite category_name=”all” id=”13″]

  28. Can’t get it to work. The page I want to show is ID=54, but I can’t get it to show.

    I applied the “Themes” category to my page, then I tried the following:

    [composite include=”54″]

    (result: blank, no posts or pages show within my main page)

    [composite post=”54″]

    [composite category_name=”Themes”]

    (result: showing all of my posts (no pages, only posts), with no filtering within my main page)

    [composite category_name=”Themes” include=”54″]

    (result: what is showing is all of my posts, with no filtering (and no pages, only posts))

    I’ve looked at http://codex.wordpress.org/Template_Tags/get_posts and it seems like I’m putting the code in there correctly. What am I doing wrong? Any ideas?

    I noticed my source is being converted to this, I don’t know if that causes a problem:

    
    [composite post="54"]
    
    

    BTW, when I use the Inline Posts plugin with [[54]] it works fine.

    The site is http://SiteSubscribe.com

  29. 2nd try…I noticed my source is being converted to this, I don’t know if that causes a problem:

    [composite post=& quot;54& quot;]

    (added spaces so not interpreted as code for this example)

  30. another David says:

    Great plugin, thanks!
    I’m trying to use the plugin for a newsfeed with a format as such;
    10.04.22 The news content.
    But I get a line break between date and post content that I can’t get rid of. No matter what I do in the custom php-file.

    Here’s my code:
    <div id=”post-“>

    How do I solve this?

  31. another David says:

    Sorry, code not displayed properly…

  32. Dita says:

    hi,
    I am really excited about finding this plugin.

    Unfortunately, it does not work for me.

    when I place [composite category_name=”mycategory”] on the new page I created for the purpose of the specific category posts I get all posts showing including the ones not linked to this category.

    Someone above had the same problem. I don’t know how to fix it. The link above to wordpress is well beyond my understanding.

    I tried different themes and my wp is upgraded to 3

    Rutkoski, are you still around to help. Or anyone else that comes across this great plugin.

    Thanks

  33. Cassius Krendler says:

    Hey, great plugin. Unfortunately it breaks the native WP image caption shortcode. If I am using the [composite…] anywhere on a page/post that also features the [caption… ] shortcode, the latter breaks and shows the actual code itself. :o(

    I tried this on a brand new, fresh installation of WP 3.0 without any plugins installed, other than yours.

    Any ideas?

  34. This is a great plugin. Unfortunately it seems that it is disabling the functionality of other WP Shortcodes used within the same post/page.

    I.e. when I insert [composite include=”1″] into my page on http://wp.nadworks.com/?page_id=2, it broke the WP native inserted image caption code (as you will notice in the image).

    I assume this is a bug, as I have no other plugins enabled and have tried this on a brand new, fresh WP installation.

    Any ideas?

  35. hi thanks for the plug-in it really helped a lot.

    Any update for pagination?

  36. can anyone help i wanted to change ‘s default text “Read the rest of this entry »”

    am i missing something

  37. mark says:

    As per a previous comment above, I’m finding the Comments form is displayed for the last post. Can’t see why its happening? Any ideas how to fix this?

  38. Steve says:

    Hi,

    This plugin works for the most part. I am having a problem, however. When I add include=x within the brackets, it doesn’t display anything on the page. If I take include out, all the posts within the category (category_name=) display. How can I get just the posts with ID = 1 to display. I’m running WP v3.0.2. Thanks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: