Support » Plugin: Network Latest Posts » php code for nlposts

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jose Luis SAYAGO

    (@iluminatus)

    Hi, you can use shortcodes in a post or a page. When dealing with templates you can use the network_latest_posts function, check this link to find the code: nlposts_templateFunction.php

    Cheers.

    Thread Starter nobodyridesforfree

    (@nobodyridesforfree)

    excuse my ignorance.

    if I enter this code in the template, does it work?:

    <? php
    / / Check if the plugin Has Been activated
    if (function_exists (‘network_latest_posts’)) {
    / **
    * Custom Parameters
    Set * Those you only want to use
    * /
    $ parameters = array (
    ‘title’ => ‘Recent Articles’
    ‘title_only’ => ‘false’,
    ‘auto_excerpt’ => ‘true’,
    ‘random’ => ‘true’
    );
    / / Execute
    network_latest_posts ($ parameters);
    }
    ?>

    Plugin Author Jose Luis SAYAGO

    (@iluminatus)

    Yes, but you may want to set only those parameters you’ll use. Here you’ll find the full list of parameters: http://wordpress.org/plugins/network-latest-posts/other_notes/

    For example, if you want to display 4 posts with thumbnails and excerpts per page then your parameters should look like this:

    $parameters = array(
          'title_only'    => 'false',
          'auto_excerpt'  => 'true',
          'thumbnail' => 'true',
          'paginate' => 'true',
          'posts_per_page' => 4
    );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘php code for nlposts’ is closed to new replies.