Ready to get started?Download WordPress


My Post Order
Post order on homepage from get_posts (4 posts)

  1. nat@cry
    Posted 1 year ago #

    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


  2. Kapil Chugh
    Plugin Author

    Posted 12 months ago #

    Sorry for late reply

    You need to put it like this

    $the_query = get_posts( array('section_name' => NAME_OF_SECTION' ));
  3. nat@cry
    Posted 11 months ago #

    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

  4. mrzpro
    Posted 10 months ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic