WordPress.org

Ready to get started?Download WordPress

Forums

Select Featured Posts
How to use this Widget with get_posts ?? (2 posts)

  1. Fahim Mahmood
    Member
    Posted 2 years ago #

    I am having trouble using it with get_posts ?? any example how to use it with get_posts

    http://wordpress.org/extend/plugins/select-featured-posts/

  2. Kapil Chugh
    Member
    Plugin Contributor

    Posted 2 years ago #

    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>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.