• Resolved polokina

    (@polokina)


    Hi Jose

    Using do_shortcode() in theme files like:
    <?php echo do_shortcode('[nlposts number_posts=5 blog_id=5,2 thumbnail=true thumbnail_filler=custom paginate=true posts_per_page=5 display_content=true sort_by_date=true sorting_order=newer sorting_limit=5 thumbnail_wh=150x100 css_style=style_nlposts]'); ?>
    in content.php is not working. What can I do to make it respond? Or better yet, if possible, how can I insert posts using plugin function and avoid using shortcode altogether?

    Thank you

    Edgar

    http://ww.wp.xz.cn/plugins/network-latest-posts/

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

    (@iluminatus)

    Hello Edgar,

    If you want to include Network Latest Posts into a theme, you could use a template and embed it as a function like this:

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

    Gist link: nlposts_templateFunction.php

    Please let me know if you need more help.

    Best regards,
    José Luis.

    Thread Starter polokina

    (@polokina)

    Worked perfectly! Thank you so much Jose

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Shortcodes, using "do_shortcode" in theme files not working’ is closed to new replies.