8ª Elite

Network Latest Posts

Network Latest Posts Official Logo

Network Latest Posts Logo

One of the things that came out when migrating from a single WordPress installation to a WordPress Network multi-site was the importance to display the latests posts from all the blogs inside my network in the main site. My first thought was “ok, maybe someone had the same issue and wrote a plugin“, if my idea wasn’t totally wrong, I couldn’t find anything suitable for my needs.

There were a lot of plugins but none of them actually gave me the freedom I needed, then I found the WPMU Recent Posts Widget written by Angelo from BitFreedom.com but it was conceived as a Widget for the ancient version of WordPress multisites (WPMU) and I was looking for something else, so what I did was to take his code and improve it to make it suitable to my needs. Thanks to his code the first versions of Network Latest Posts existed. I’d also thank people who contributed with their ideas and patches, thanks for your invaluable feedback! (you’re listed inside the main file, go check it out ;) )

Network Latest Posts today is way too different from what it used to be in past versions, it no longer uses Angelo’s code. Network Latest Posts version 3.0 is a major release, it was totally rewritten to use WordPress hooks and core functionalities which makes it run faster, and easy to maintain. Goodbye hackery and nasty workarounds, it wasn’t easy, I barely slept during the coding process, but it was worth it, it was fun, I learnt a lot of things I didn’t know and realized that WordPress advanced features need better documentation.

Enough introductory drivel. Let’s see the functionalities available in this version:

  • @title : Widget/Shortcode main title (section title)
  • @number_posts : Number of posts BY blog to retrieve. Ex: 10 means, retrieve 10 posts for each blog found in the network
  • @time_frame : Period of time to retrieve the posts from in days. Ex: 5 means, find all articles posted in the last 5 days
  • @title_only : Display post titles only, if false then excerpts will be shown
  • @display_type : How to display the articles, as an: unordered list (ulist), ordered list (olist) or block elements
  • @blog_id : None, one or many blog IDs to be queried. Ex: 1,2 means, retrieve posts for blogs 1 and 2 only
  • @ignore_blog : It takes the same values as blog_id but in this case this blogs will be ignored. Ex: 1,2 means, display all but 1 and 2
  • @thumbnail : If true then thumbnails will be shown, if active and not found then a placeholder will be used instead
  • @thumbnail_wh : Thumbnails size, width and height in pixels, while using the shortcode or a function this parameter must be passed like: ’80×80′
  • @thumbnail_class : Thumbnail class, set a custom class (alignleft, alignright, center, etc)
  • @thumbnail_filler : Placeholder to use if the post’s thumbnail couldn’t be found, options: placeholder, kittens, puppies (what?.. I can be funny sometimes)
  • @custom_post_type : Specify a custom post type: post, page or something-you-invented
  • @category : Category or categories you want to display. Ex: cats,dogs means, retrieve posts containing the categories cats or dogs. If any articles match the category(ies) provided, all posts matching the rest of the parameters will be shown
  • @tag : Same as categoy WordPress treats both taxonomies the same way; by the way, you can pass one or many (separated by commas). If any articles match the tag(s) provided, all posts matching the rest of the parameters will be shown
  • @paginate : Display results by pages, if used then the parameter posts_per_page must be specified, otherwise pagination won’t be displayed
  • @posts_per_page : Set the number of posts to display by page (paginate must be activated)
  • @excerpt_length : Set the excerpt’s length in case you think it’s too long for your needs Ex: 40 means, 40 words (40 by default)
  • @auto_excerpt : If true then it will generate an excerpt from the post content, it’s useful for those who forget to use the Excerpt field in the post edition page
  • @excerpt_trail : Set the type of trail you want to append to the excerpts: text, image. The text will be _more_, the image is inside the plugin’s img directory and it’s called excerpt_trail.png
  • @full_meta : Display the date and the author of the post, for the date/time each blog time format will be used
  • @sort_by_date : Sorting capabilities, this will take all posts found (regardless their blogs) and sort them in order of recency, putting newest first
  • @sorting_order : Specify the sorting order: ‘newer’ means from newest to oldest posts, ‘older’ means from oldest to newest
  • @sorting_limit : Limit the number of posts to display. Ex: 5 means display 5 posts from all those found (even if 20 were found, only 5 will be displayed)
  • @post_status : Specify the status of the posts you want to display: publish, new, pending, draft, auto-draft, future, private, inherit, trash
  • @css_style : Use a custom CSS style instead of the one included by default, useful if you want to customize the front-end display: filename (without extension), this file must be located where your active theme CSS style is located. If multiple instances are used in the same page, all of them will be affected by this value (so you don’t need to pass this parameter to all the shortcodes/widgets included in the same page)
  • @instance : This parameter is intended to differenciate each instance of the widget/shortcode/function you use, it’s required in order for the asynchronous pagination links to work

Installation

1. Upload `network-latest-posts folder` to the `/wp-content/plugins/` directory or go to the Network Admin panel > Plugins > Add New and search for Network Latest Posts
2. Activate the plugin for the network through the ‘Plugins’ menu in WordPress Network Admin panel
3. If you want to use the Widget, you can add the Network Latest Posts widget under ‘Appearance Widgets
4. If you want to use the Shortcode, go to a page or post then click the NLPosts icon NLPosts Icon  in the TinyMCE editor or use [nlposts] (that’s it, seriously!)

Shortcode Parameters


[nlposts title=NULL
          number_posts=10
          time_frame=0
          title_only=TRUE
          display_type=ulist
          blog_id=NULL
          ignore_blog=NULL
          thumbnail=FALSE
          thumbnail_wh=80x80
          thumbnail_class=NULL
          thumbnail_filler=placeholder
          custom_post_type=post
          category=NULL
          tag=NULL
          paginate=FALSE
          posts_per_page=NULL
          excerpt_length=NULL
          auto_excerpt=FALSE
          excerpt_trail=text
          full_meta=FALSE
          sort_by_date=FALSE
          sorting_order=NULL
          sorting_limit=NULL
          post_status=publish
          css_style=NULL
          instance=NULL
]

The $nlp_instance adds a class ‘.nlp-instance-X‘ where X is the instance identifier passed through the shortcode parameters (in case of Widgets this parameter is automatically taken from the Widget ID numbers for each instance created).

Screenshots

Shortcode

NLPosts Edit Page Shortcode in TinyMCE added

NLPosts Shortcode in Edit Page

NLPosts Insert Shortcode using the form

NLPosts Insert Shortcode Form

NLPosts Shortcode Output

NLPosts Shortcode Output

NLPosts Shortcode Pagination

Results by Page

_____________________________________________

Widget

NLPosts Widget Areas

NLPosts Multi-instance Widget

NLPosts Widget Options

NLPosts Widget: Some Options

NLPosts Sidebar Widget Area

NLPosts Sidebar Widget Area

NLPosts Footer Widget Area

NLPosts Footer Widget Area

______________________________________________________

RTL Installations

NLPosts in RTL Installation

NLPosts in RTL Installation

NLPosts Shortcode & Widget in RTL

NLPosts Shortcode & Widget in RTL

_____________________________________________________

Examples

You can see this plugin working in my main network site www.8elite.com, I display there the latest posts from all the blogs inside my network. For full examples of use, please visit Network Latest Posts Test Lab.

Download

Download the latest version from the WordPress Plugin Directory: Network Latest Posts

Languages

This plugin is available in English, French, Spanish because that’s all the languages I know :) and Italian (thanks to Valentino Deotto), if you would like to contribute to this project you can use the languages.pot file included inside the languages folder inside the plugin’s root folder. Use Poedit to create the translation files, once you have the .mo and .po files send them by mail to opensource[at]laelite.info make sure you include your name and URL (if you have one) so I give you credit for it.

Donations

If you think this plugin is great and makes your life easier and your blogs look better, please consider making a donation. Even $1 can make a difference :) !





  • Valentino Deotto

    Very useful plugin!!!

    • http://laelite.info/ L’Elite

      Hello Valentino, I’m glad you find it useful. Thanks again for your feedback and patches. Happy blogging!

  • shawn

    Just found this plugin today and wanted to drop a note saying thank you! it is amazing. I have only just begun to use it and already, every question I have, seems to be already answered in the code. You literally thought of everything.

    thanks again

    • http://laelite.info/ L’Elite

      Thanks for your comment; I’m glad you find it useful, if you find something is not working as expected just post a thread on the support forum and I’ll check it as soon as possible.

      Remember to rate it and vote if it works on WordPress so others can download it without hesitation, cheers.

  • adventurelearningat

    Hi, great plugin! It was just what I was looking for.

    I’m having trouble getting my custom stylesheet (style.css) to work with it though. I’m not sure if I’m using the incorrect CSS classes for the list and block wrappers, but I’ve tried everything and nothing seems to change. I’m using two instances of your plugin on the elbee elgee theme, and I’d like both instances to have the default elbee elgee style applied to them.

    • http://laelite.info/ L’Elite

      Hello!, thanks for your comment. Well, the stylesheet must be placed in your active theme’s main folder. Then use the css_style parameter to pass the filename for example, if your file is called custom_nlposts.css then you should set it like: css_style=custom_nlposts. When setting styles remember to add !important at the end of each rule so you force the browser to apply them.

      Other thing, WordPress usually caches styles for a while, so make sure you clean the cache (or test the site from another browser) so you see the new styles applied. One more thing, the css_style parameter only affects the instances placed inside the same page, so if you are using NLPosts in different pages, every page should contain the css_style parameter pointing to your custom stylesheet.

      Let me know if there’s anything else I can help you with.

      Cheers.

      • adventurelearningat

        Thanks for the quick reply! The custom stylesheet I’m trying to use with your plugin is my theme’s default stylesheet…would I still need to use the css_style parameter?

        Sorry, I’m a beginner with all this so when you say “use the css_style parameter” I’m not sure where I should do that. Does that happen in a PHP file, my style.css file or in your plugin’s settings menu in my widgets dashboard?
        If I put my CSS file name (style.css) in the text field titled “Custom CSS filename” in your plugin’s menu do I still have to list the CSS classes for the list and block wrappers? Or can I leave those blank?

        I don’t think it’s a cache issue because your default style goes away when I add my stylesheet’s file name or change the name of the CSS classes for the list and block wrappers, but the style I want doesn’t get applied. It just looks like a normal unordered list with no CSS.

        Thanks again for your help!

        • http://laelite.info/ L’Elite

          Hi, I see. Well you can’t use your theme stylesheet because you still need the plugin classes, so everything will be rewritten by the plugin stylesheet. I don’t know how are you using my plugin, as a widget or using the shortcode? If you are using the shortcode then you have to set it like this [nlposts css_style=my_custom_style]. If you’re using the widget then just enter my_custom_style in the Custom CSS Style field.

          I downloaded that theme and created a style to adapt the plugin, download this file: http://laelite.info/opensource/wordpress/plugins/elbee_nlposts.css and put it into the elbee theme folder (wp-contents/themes/elbee-elgee) then if you are using the shortcode add css_style=elbee_nlposts … If you are using the shortcode form or the widget enter in the Custom CSS Style field elbee_nlposts

          Here is a screenshot I took so you can see how it looks like: http://postimage.org/image/5ikhpgvat/

          With CSS you can do magic :) … Cheers.

  • goutham

    How to use this as a function and replace my index page

  • Anton Channing

    Nice. I really like the ‘sort_by_date’ feature, that works a treat. One little request. In previous version, I was able to style each entry according to which site it originated from because you had custom css classes with the site id. Could you add the site id of each post into a custom css class like…

    …I’d be so grateful if you could, I’d probably make a small donation to this plugin. Thanks!

    • http://laelite.info/ L’Elite

      Hello Anton, you are right. I thought nobody found it useful so I removed them. I’ve just pushed version 3.4.1 which includes the CSS class to each element the way you posted “nlposts-siteid-x” where x is the blog ID. Cheers.

      • Anton Channing

        Thanks. This plugin now does exactly what I need it to. I hope my small donation helps to reward your efforts in some small way. Ewige Blumenkraft und ewige Schlangenkraft.

  • Anton Channing

    I’ve noticed two minor bugs. Not show stoppers, but thought you might like to be aware of them in case they are easy to fix. 1) Posts are sorted by their last edit date, rather than their first posted date (maybe that’s a feature?). 2) If more than one network site has a post with identical shortnames, (ie ‘hello-world’), then all the posts will end up linking to only one of those sites, although they’ll all have their correct post dates and authors.

    • http://laelite.info/ L’Elite

      Hello Anton, thanks for your donation. Regarding your points: 1.- Yes I set it that way, if you want to order them by the date they were published replace this $blog_key.$post->post_modified by $blog_key.$post->post_date on lines 439 & 446 from network-latest-posts.php file. 2.- I haven’t seen that behavior but I’m going to do some tests to make sure. Thanks for your feedback.

      • Anton Channing

        Okay thanks. I’ve made the changes you’ve suggested as I sometimes add tags to old posts and I don’t want to bump them to the top for the sake of a new tag or two. Incidentally, if you could add a link to this new version of the page about the ‘network latest posts’ plugin from the old one that would be great, as I keep arriving at the old one from a google search and then wondering how to get here… :D Have a great End of the World(tm of Mayan Civ), Solstice, Yule, Christmas, Saturnalia, New Year or whatever else you celebrate at this time of year… ;D

        • http://laelite.info/ L’Elite

          Hello, Merry Christmas. The listing by publish date or update date is already on my TODO list, I know some people prefer that way. I’m also working to clean and improve my sites, it’s a work in progress so people can easily find information about this plugin. Thanks for the heads up, enjoy your holidays.

  • imtiedup

    Two suggestions for future versions:

    1. It would be really nice if in addition to being able to choose list/block output format, if we had an admin where we could pre-build some templates and then choose from those templates.

    For instance:

    I use bbPress forums and wanted to display the forum table from one blog on another blog. There is a lot more markup involved than just a list or custom block in order to output a table or something that appears like a table. It would be nice if I could pre-build my table, and then choose it from the dropdown list.

    that brings me to the next idea

    2. I want to bring over much more than just the title content and featured image.

    Please allow us to bring over custom fields as well.This is pretty much the one missing step for being able to bring over any type of content from one blog to another as today I pretty much build everything as custom post types and then use “AdvancedCustomFields” plugin to create my custom fields for each of my custom data types.

    Between being able to define templates, and being able to transfer over custom fields as well, that pretty much gives us the ability to do 90% of anything our mind can imagine. Now THAT would be one amazing plugin!

    • http://laelite.info/ L’Elite

      Hi, thanks for your suggestions. I will keep them in mind.

      • imtiedup

        That’s all I can ask for. I have absolutely loved using this plugin on so many projects over the past month or so, and those ideas are pretty much the only thing I always find myself wishing it could do. This is so much easier than manual use of switch_to_blog() and doing everything by hand, though there are times I obviously still have to do that. With these changes, then I can forget about that function forever, which will be so nice.. lol

  • Antonio Spampinato

    Hi, thanks for your work.

    I’m testing your plugin on my blog (WPMU & Thesis theme). My goal is show the last posts of the network on the main section of the home page with the same style of the post’s theme.
    I think that the best work to do is using your plugin as a function. For do this, I pasted this code on the custom_function.php file:

    if( function_exists(‘network_latest_posts’) ) {

    $parameters = array(
    ‘title’=>’Testing NLPosts as a Function’
    );
    network_latest_posts($parameters);
    }

    add_action(‘thesis_hook_before_content’, ‘network_latest_posts’);

    but I have 2 problems:

    1) the latest posts show in the main section and on the top-left of the page (see pic)

    2) Where ad how (please, if you can, write me if I need to use < or $ or … dot) I need to past tha parameters code? On the custom.css file?

    Thanks so mutch

    antonio

    • http://laelite.info/ L’Elite

      Hello Antonio,

      Thanks for your comment, I guess you see them twice because you’re using a hook, try without ” add_action(‘thesis_hook_before_content’, ‘network_latest_posts’); ” When using ” network_latest_posts( $parameters ); ” it will automatically insert the output where you place it.

      If you want to use it with a hook, then you must transform your code into a function, check this example: http://codepad.org/PSyMj987

      When using it as a function with the WordPress hook, that code should be placed inside your theme’s custom_functions.php file. Let me know if you need more help.

      Best Regards.

      • Antonio Spampinato

        Thank you, really, for the fast reply.

        I tried this:

        1) I past this code inside custom_functions.php (maybe is the wrong place) without add_action(‘thesis_hook_before_content’, ‘network_latest_posts’); but show the post out of the theme area (on the top-left)

        if( function_exists(‘network_latest_posts’) ) {

        $parameters = array(

        ‘title’=>’Testing NLPosts as a Function’

        );

        network_latest_posts($parameters);

        }

        2) I past the same code inside functions.php, same result.

        3) I past this code inside custom_functions.php but return a totally white site

        function my_recent_posts() {
        if( function_exists( ‘network_latest_posts’ ) {
        $parameters = array(
        ‘title’ => ‘Testing NLPosts as a Function’
        );
        return network_latest_posts( $parameters );
        } else {
        return false;
        }
        }

        add_action( ‘thesis_hook_before_content’, ‘my_recent_posts’ );

        Where I’m wrong?

        thanks

        • http://laelite.info/ L’Elite

          Hello Antonio,

          Only your third choice is right, as I said before if you paste your first option in your functions.php or custom_functions.php file it will result in an error.

          If your third option results in a blank page it’s because there are errors in your PHP code. Please make sure your custom_functions.php is well formatted, or simply copy and paste this code in your custom_functions.php: http://codepad.org/t7hGPf2C

          Thesis uses custom_functions.php to load customized functions into your theme templates, when using add_action you’re “hooking” your function to the one rendering content, so it must be placed along with your function. I believe using this code should make it work as expected: http://codepad.org/t7hGPf2C

          By the way make sure your custom_functions.php have nothing before or after tags or it will fail.

          Remember, make sure to delete any other references to network_latest_posts in other files you may have changed.

          Let me know if it works.

          Regards.

          • Antonio Spampinato

            I’m sorry, but don’t work. The site is blank. This is my custom_functions.php, do you see somethings wrong? (I have deleted one of 2 <?php code that you see on the file but is the same, and deleted all network_latest_post references)

          • http://laelite.info/ L’Elite

            Hello Antonio, yes my bad, there is one ‘)’ missing from: if( function_exists( ‘network_latest_posts’ ) ) { please replace your code by this one: http://codepad.org/kJgUgDJi and let me know if it works

          • Antonio Spampinato

            Yea, work! Thanks so much!

            now I need to show the post with the theme style. Where I put “@css_style”? again in custom_functions.php?

          • http://laelite.info/ L’Elite

            Great news Antonio!,

            Well you need to pass another parameter to your function, in this case ‘css_style’ => ‘mystylesheet’ then create an empty file called mystylesheet.css and save it to your main Thesis theme folder (where style.css is found) if you want examples of custom css styles you can check these ones: http://laelite.info/opensource/wordpress/plugins/elbee_nlposts.css, http://laelite.info/opensource/wordpress/plugins/default_opacity.css

          • Antonio Spampinato

            Thanks, I try. If you can help me for customize this and other website for other things that your great plugin, please send me a private mail with your contacts.

            Thank you again and have a good night.

          • http://laelite.info/ L’Elite

            Hi Antonio, I’ve sent you an email. Have a good night.

  • http://www.facebook.com/gerard.bik.1 Gerard Bik

    Hi L’Elite

    Tried this very useful plug in on a Multisite I’m setting up. I already see lots of possible uses.

    On the (static) homepage I want to show the latest post, Just one complete post. Is there a way to show the whole post, not just an excerpt?

    I already tried setting the excerpt length to 200, but something unexpected happens: shorter posts are still excerpted.

    I also tried your Single Latest Posts Lite plug in, same result.

    Thanks

    • http://laelite.info/ L’Elite

      Hello Gerard,

      Well, that’s not possible right now, but I find it interesting. You could tweak the code to display content instead of excerpts. I’m going to check what can I do. I will keep you posted. Thanks for your feedback.

      Regards,
      José Luis.

    • http://laelite.info/ L’Elite

      Hello again,

      I’ve pushed v3.5 which includes a new parameter “display_content” which is set to FALSE by default, when set to TRUE it will display posts’ content instead of excerpt. Cheers.

      • http://www.facebook.com/gerard.bik.1 Gerard Bik

        Wow, you are quick. This is exactly what I needed.
        Now I’m going to dive into the css, to tweak the appearance.
        Thanks!

  • http://www.facebook.com/SafetyOfficerOnline Fuad Jalilov

    Hi, May i use this plugin to parse posts from different web sites? If yes, then how? i can’t find shortcode where i could enter the URL for the web page i want to grab the excert from.

    • http://laelite.info/ L’Elite

      Hello Fuad,

      Sorry this plugin doesn’t work with external sites, Network Latest Posts need access to WordPress database to pull information. What you’re looking for is a RSS parser, but I don’t know if there’s any available which allows you to do the same things this plugin does.

      Regards.

  • http://www.facebook.com/gerard.bik.1 Gerard Bik

    Just found out something strange. Maybe it has nothing to do with NLP and it is a general WordPress thing.
    While testing everything, I password protected a post, just for fun. You cannot see the content until you enter the password. But in the NLP summary I see the content. No protection any more.

    I am probably never going to use this password feature, but isn’t this strange behaviour?

    • http://laelite.info/ L’Elite

      Hello,

      Network Latest Posts pull posts matching post_status parameter, WordPress doesn’t change post status when password protecting them, so queries must be filtered to exclude them. I will keep this in mind for future releases.

      Thanks for your feedback.

  • Anton Channing

    I’ve been playing with your new ‘display_content’ and made a bug fix that I’d like to contribute back upstream. In your code you used ‘nl2br($content)’ to format the content, however this does not correctly process shortcodes. So in all the places this code appeared, I replaced it with ‘do_shortcode($content)’. Viola! Posts with shortcodes (such as the the [youtube] tag from Vipers plugin), now display correctly.

    • http://laelite.info/ L’Elite

      Hi Anton, thanks for your feedback. I’ve replaced nl2br by do_shortcode. Actually it does replace shortcodes but I’m aware some plugins just simply are not recognized by WordPress as valid shortcodes, I was aware of Visual Composer now I realize Viper’s present the same issue.

      I don’t really know why is that, it seems there’s something wrong with those plugins, anyway, I’ve pushed the new version, it will be available in a minute or so. Cheers.

      • Anton Channing

        I was wrong. I think nl2br should be called as well as do_shortcode. Otherwise the text doesn’t paragraph where it should.

        • http://laelite.info/ L’Elite

          Hello Anton, I know you wrote that 2 months ago, sorry for the late response. I’ve been really busy and experiencing connexion problems. I noticed that, since your comment and other feedback I’ve received I’ve improved the excerpt function to combine nl2br and do_shortcode, it should be working as expected now. Thanks for the heads up.

  • Pingback: WP Multisite Network Posts | DreamKunst

  • Pingback: Network Latest Posts – WordPress 3 Plugin | 8ª Elite in English

  • Ranadeep Ghose

    Awesome plugin and a sure shot life saver for me! Just need to know 2 things – 1. how can I make the links open in a new tab? 2. Can I have multiple @custom_post_type e.g. posts, myCustomPost, store?

  • David Hicking

    It seems that sorting by date is broken for me – here’s my code:[nlposts title='Latest Blog Posts' paginate=true posts_per_page=7 number_posts=7 time_frame=30 ignore_blog=14 title_only=false full_meta=true auto_excerpt=true excerpt_length=20 sort_by_date=TRUE sorting_order=NEWER]

    • http://laelite.info José Luis

      Hi, it seems right to me, are you using the latest version of Network Latest Posts? However I’m about to release an update which will include improvements for sorting functionalities.

    • http://laelite.info/ L’Elite

      Hello David, thanks for your feedback. I’m going to check the sorting functions to see if there is something wrong with them.

      • Andy Freeman

        Perhaps by design… on line 464 is

        // Put everything inside another array using the modified date as
        // the array keys
        $all_posts[$post->post_modified] = $post;

        To sort by post date this should be:

        $all_posts[$post->post_date] = $post;

        • http://laelite.info/ L’Elite

          Hello Andy,

          You’re right about the date, however, there is people like me who prefers to give some visibility to old posts when updated. I’m working on a new version which will allow people to choose if they want to order by post_date or post_modified, that way both will be satisfied when using the sorting functionality.

          Thanks for your feedback.

  • Kevin

    thanks for the great plugin. How can I center the text and image of the shortcode so more then thumbnail is centered. I want it all centered

    • http://laelite.info/ L’Elite

      Hello Kevin, sorry for the late response. You could use a modified CSS style for that, I’ve made one, you’ll find it here: http://laelite.info/opensource/wordpress/plugins/nlp-aligncenter.css. Attached two screenshots, one with the style by default the other with display_type=block

      To use the css, just save it to your active WordPress theme folder, then in your shortcode use the css_style parameter like this:

      [nlposts css_style=nlp-aligncenter] << default
      [nlposts display_type=block css_style=nlp-aligncenter] << block

      Let me know if you need more help.

      Best regards,
      José Luis.

  • stefanredcat

    Is it important to fill in “Instant Identifier”? I don’t know what it means..

    • http://laelite.info José Luis

      Hi, if you are using only 1 shortcode, then no, it’s not important. “instance” is useful when you’re using multiple shortcodes with pagination in the same page, it’s used to treat each one separately.

    • http://laelite.info/ L’Elite

      Hi, the instance identifier is only needed when you intend to use multiple shortcodes and pagination in the same page. The instance identifier is used within the ajax jQuery function that makes pages load without reloading the whole site. If you use multiple shortcodes with pagination but forgot to set the instance parameter for each one of them, once you click on a page number, it will change the page for all shortcodes.

      To resume:

      If you plan to use multiple shortcodes with pagination in one page then yes it’s “very” important:

      Examples:

      [nlposts category=mountains paginate=true posts_per_page=5 instance=cold-landscapes]

      [nlposts category=deserts paginate=true posts_per_page=5 instance=warm-landscapes]

      Hope this helps.

  • stefanredcat

    The shortcode doesn’t work :( it is not displaying anything, please help!

    • http://laelite.info José Luis

      Hello, could you please show me the shortcode parameters you’re using?

    • http://laelite.info/ L’Elite

      Hello, could you please check the answer I wrote to Angela’s question?: http://en.8elite.com/network-latest-posts/#comment-780939835 I need more information so I can help you solve your issue.

      Cheers.

  • http://www.facebook.com/angela.leonebaron Angela Leone Baron

    I have just downloaded this plugin to my wordpress site, but I can’t get it to work. I want to use the short code version to put my most recent post on my static home page. I don’t understand what to put into the Instance Identifier field. I am just beginning with code, so please be gentle.

    • http://laelite.info/ L’Elite

      Hello Angela, I would like to ask you something. Are you using a WordPress Network (Multiple WordPress sites running under one main site, for example the wordpress.com community)? or is it a single website running WordPress?

      To pull recent posts you just have to set in a page [nlposts] however if your site is running the single installation it will not work, I’ve created a plugin for single WordPress installations called Single Latest Posts, below the links:

      Pro version: http://single-latest-posts.laelitenetwork.com

      Lite version (free): http://wordpress.org/extend/plugins/single-latest-posts-lite/

      Once you have identified which plugin is suitable for your website, then, what you must do next is to set your WordPress this way:

      1.- Create a new Page called “Recent Posts” or something like that, and put as content the shortcode [nlposts] or [slposts] (depending if you’re using multisites or single site).

      2.- Then go to the Settings > Reading

      3.- Front page displays:

      3.1- Select “a static page”, then choose as “Front page”: Recent Posts, “Posts Page” leave it blank.

      4.- Save your changes and that’s it.

      Hope this helps, let me know if you need more assistance.

      Best regards,

      José Luis.

  • Katelyn05

    I am running multisite and would like to hardcode this into my sidebar and footer. Is there some type of template tag I could use?

    • http://laelite.info/ L’Elite

      Hi, sorry, could you please explain what would you like to hardcode? If you want to use the plugin in your sidebar you can use the Widget, if your theme has a footer widgetized then you could add the widget to the footer too. For examples of use (when using shortcodes) check this site: http://testlab.8elite.com/

      However, if you want to do it yourself, you can add a function like this one: http://codepad.org/C9Md2ehL to your templates, of course all parameters are listed in this article, you just have to adapt the code to your needs.

      If you need more help, please don’t hesitate to ask.

      Best regards.

      • Katelyn05

        I am looking to hardcode the widget into my sidebar template so it shows on all the sites across my network. If I use a widget, it would have to be manually added to each sites sidebar.

        • http://laelite.info/ L’Elite

          Hello, then embedding it as a function is the way to go, here’s an example: http://codepad.org/FqE51lUt just replace those parameters by the ones you’d like to pass, the linked example will display posts titles and excerpts generated from content. The list of parameters is found under the “Shortcode Parameters” in this post, just pass them as array elements.

          Cheers.

          • Katelyn05

            Great, I’ll give it a shot! Thanks!

  • Tine

    Hi,
    I’ve heard so many good things aout this plugin, but I’m new to this and I got a really stupid question (now you’re warned!). Where do I add the URL from the different blogs?
    Thanks a lot :)

    • http://laelite.info/ L’Elite

      Hello, well, this plugin was built for the multisite version of WordPress (WordPress Network: http://codex.wordpress.org/Create_A_Network). Once you install it, check the examples found here: http://testlab.8elite.com/.

      However, it won’t work if what you want to do is to list posts from individual blogs. To do so you would need to install a plugin built for RSS feeds.

      Let me know if you need more information, I’d be glad to help.

  • Pingback: WP Multisite Network Posts | jaffamonkey Quality Assurance

  • Tony Henrie

    Just installed your plugin on my site. Works great, but I’d like to change two small details, if possible. I am using the widget, listing two posts per blog with metadata, English rtl. Site is westerntrailrider.com.

    1) I’d like to be able to select what metadata information to display, such as author name, date, category, rather than having to show it all or none.

    2) I’d like to remove the space beneath the post title, between the post title and the metadata, so that the metadata shows up immediately below the blog post title. As it is now, it wastes a lot of space and limits the number of posts I can show without pushing everything else too far down the page.

    I’m not smart enough to do it myself. You help would be appreciated.

    • http://laelite.info/ L’Elite

      Hi Tony, I’m working on a new version which will make it easier to adapt. I will send you a customized version, so you can use that until the new version is available. However, I will need a couple of days to get it done, there are others on my waiting list.

      • Tony Henrie

        On my original post I indicated “English rtl”. Oops, that’s English ltr. Thanks for the quick response.

  • Dirk

    Hi,
    is it possible to use your plugin to show forums/topics/reply of bbress on one site of a wordpress multisite with several forum of bbpress on subdomains. Would be great.
    Kind regards

    • http://laelite.info/ L’Elite

      Hello Dirk, I’m not completely sure this can be done without tweaking the code. As far as I know, bbpress creates its own database tables. It’s possible topics and replies are stored inside them. I will take a look into it, if there’s a possibility to do this without changing too much code, I can include it as a feature in a future version.

  • Anton Channing

    Hi! I’m continuing to enjoy this plugin and would like to submit another change I’ve made back upstream:

    Basically I’ve changed the code in for $author_url (in two places) to:

    // The network’s root (main blog) is called ‘blog’,
    // so we have to set this up because the url ignores the root’s subdirectory
    if( $all_blogkeys[$field->guid] == 1 ) {
    if (function_exists(‘bp_is_active’)) {
    // Author’s buddypress page
    $author_url = ${‘blog_url_’.$all_blogkeys[$field->guid]}.’/members/’.$author->user_login;
    } else {
    // Author’s page for the main blog
    $author_url = ${‘blog_url_’.$all_blogkeys[$field->guid]}.’/blog/author/’.$author->user_login;
    }
    } else {
    // Author’s page for other blogs
    $author_url = ${‘blog_url_’.$all_blogkeys[$field->guid]}.’/author/’.$author->user_login;
    }

    This adds support for buddypress, which doesn’t have a /blog/author/username page or a /author/username page. Instead, for such a site, I’ve linked the author_url to their buddypress profile page.

    Also, a request: Any chance of an option to display number of comments or invitation to post first comment at end of article? With link to comment form?

    • http://www.facebook.com/olafvantol Olaf van Tol

      Hi Anton,
      I like the idea of you support for Buddypress, but not 100% sure which lines to replace with your code. Would you mind sharing the editted plugin php with me?

      • Anton Channing

        Hi sorry, only just noticed your reply. It is possible I missed a couple I suppose. I know the edits I made worked for me, but perhaps the other two cover instances I’m not using, or haven’t yet noticed are broken… :)

  • KruChicago

    Hi. Maybe I don’t understand. How do I link the widget to my other blog (blog A) to get the latest post displayed on this blog (blog B)?

    • http://laelite.info/ L’Elite

      Hello Adamkru, this plugin works on WordPress Networks only, if your Blog A and Blog B are individual WordPress installations it will not work. I’ve already added to my TODO list build a plugin to interact between multiple individual blogs.

  • Pingback: Uppgift WordPress | PHP-utvecklare

  • http://www.facebook.com/olafvantol Olaf van Tol

    Hi, your plugin looks really useful, but it doesn’t seem to work 100% for me. When I use the shortcode with time_frame=6 (added both manually and via shortcode button) it still shows all posts, not limited by the time range. I’m on WordPress 3.5.1. with Buddypress 1.7

    • http://laelite.info/ L’Elite

      Hi Olaf, actually several people has complained about the publish date and last update, I’m working on a new version which will include the ability to pick between both of them. It’s taking more than expected because I’ve been really busy. I’ll let you know once it’s been released. Cheers.

  • Arabelle

    Not all my blogs show in the blog_id dropdown :(

    • http://laelite.info/ L’Elite

      Hello Arabelle, could you please tell me if those blogs not listed are public? This version doesn’t display posts from blogs set invisible, archived, mature, spam or deleted.

      • Arabelle

        Hey, thanks for the fast turn around.
        hihi i edited my message already in the 3rd time, right, in site/blog setting it wasnt public.

        • http://laelite.info/ L’Elite

          Hi, now that they’re public you can see them listed?

          • Arabelle

            yes, its working properly.

          • http://laelite.info/ L’Elite

            Hello, thanks for the feedback. Cheers :)

  • http://twitter.com/luisdiazvenero Luis Diaz Venero

    Very nice plugin!
    Is there a way to show the category and/or site from each post displayed?

  • http://laelite.info/ L’Elite

    Hi,

    Well, I haven’t tested integration with bbpress but I see why you’re getting that kind of results, when mixing two custom post types you will get results mixed, so if your content from reply are more recent than those from topic then reply will take the lead.

    I’m guessing here so you will need to check, if you change your shortcode by this one:

    [nlposts title_only=false blog_id=4 excerpt_length=70 auto_excerpt=true custom_post_type=topic sort_by_date=true sorting_limit=10 css_style=prayer-css wrapper_list_css="last-10-prayer"]

    What are the results? I don’t know if the date is updated every time a user reply to that topic, I think you will need to tweak network latest posts in order to pull results.

    Posts are ordered by the post_modified date, you need to check if that field is affected when users reply to a topic, if so, then you just need to use custom_post_type=topic in order to display recent updated topics, but again, I’m not sure how bbpress is integrated to your blog and if user replies affect posts dates.

    To conclude, if you want to display only topics containing new replies then you will have to make sure ever time a user replies to a topic, the topic post_modified date is updated, otherwise you will need to tweak the plugin in order to handle that kind of integration.

    Edit: I have noticed you are using buddypress, I haven’t tested integration with buddypress, nonetheless I will do some tests to see how it integrates, I can’t promise a quick solution to this but I’m currently working on a new version, will do my best to provide integration with buddypress if possible.

  • imtiedup

    Awesome.
    Like I said your plugin is amazing as it is, these are just some edge case ideas and concepts to maybe make it better. I’ll look at the ‘most recent topics’ shortcode from bbPress to see how JJ handles it, as that shortcode works perfectly, showing most recent topics with the replies logic in it. Might be my best starting point.

    I can see just about anyone running a network site wanting the ability to display recent topics from other sites on the network. The bbPress shortcodes don’t have a blog_id parameter, nor can they accept switch_to_blog() natively, which of course either would be great solutions, hence my using your plugin to fill in the gap.