Support » Plugin: Select Featured Posts » [Plugin: Select Featured Posts] How to use this Widget with get_posts ??

Viewing 1 replies (of 1 total)
  • Plugin Contributor Kapil Chugh

    (@kapilchugh)

    Try to use this one. I haven’t tested it, so I’m not sure.

    <ul>
    <?php
    if (function_exists('featured_posts')) {
      featured_posts('add');
    }
    global $post;
    $args = array( 'numberposts' => 5, 'offset'=> 1, 'category' => 1 );
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) :  setup_postdata($post); ?>
      <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach;
    if (function_exists('featured_posts')) {
          featured_posts('remove');
        }?>
    </ul>
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Select Featured Posts] How to use this Widget with get_posts ??’ is closed to new replies.