Support » Plugin: My Post Order » Post order on homepage from get_posts

  • Hi
    First the plugin is just what we need for our new website as other plugins don’t quite work.
    How would I get the odering to happen where do I need to add the section name parameters bit?

    This is my code
    $the_query = get_posts( array(‘category’ => 2006 , ‘numberposts’ => 10 ));

    foreach( $the_query as $post ) : setup_postdata($post);
    $link = ‘%s‘;
    <div id=”post-<?php the_ID(); ?>” class=”milhouse_single_col”>
    <?php if ( has_post_thumbnail() ) {
    <h1><?php printf($link,get_the_title()); ?></h1>
    <p><?php the_excerpt(); ?>
    <?php wp_link_pages( array( ‘before’ => ‘<div class=”page-link”>’ . __( ‘Pages:’, ‘twentyten’ ), ‘after’ => ‘</div>’ ) ); ?>
    if ($classPosition==”right”) echo “</div>”;

    if ($classPosition==”left”) echo “</div>”;
    Any help much appreciated THanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Kapil Chugh


    Sorry for late reply

    You need to put it like this

    $the_query = get_posts( array('section_name' => NAME_OF_SECTION' ));

    Hi Kaplin

    Thanks for your reply, I have treid the new code and even created a page to test it on but no luck, all it does is grab the newest posts rather than the order I have created, any ides?

    Your help is very much appreciated

    Thanks Nat

    Dear Kapil, I’ ve the same problem but it’ s impossible to show the feed in the home page.
    My “section_name” is “News” and my “NAME_OF_SECTION” is already “News”, I have modified your lines but without result.
    There is something wrong can you help me?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Post order on homepage from get_posts’ is closed to new replies.