WordPress.org

Support

Support » Plugins and Hacks » My Post Order » [Plugin: My Post Order] Sorting for sidebar

[Plugin: My Post Order] Sorting for sidebar

  • Hi Kapil Chugh,

    first of all thank you for this awesome plugin!

    It works great.
    I insered <?php query_posts(‘section_name=SECTION_NAME’) ?> in my template and everything is fine.

    I have a question about using this ordering for the related links in my sidebar. My sidebar is also integrated in the Theme. So I don’t use the widgets and need how to sort them there too.

    Can I put there a code into too to order these related links of the same categorie?

    Thank you very much

    My Sidebar-Code is:
    <div class=”right”>
    <div class=”widget_recent_entries”>
    <h2 class=”widgettitle”>Recent Articles</h2>

      <?php
      global $post;
      $args = array( ‘numberposts’ => 10, ‘offset’=> 1, ‘category’ => 8 );
      $myposts = get_posts( $args );
      foreach( $myposts as $post ) : setup_postdata($post); ?>

    • “><?php the_title(); ?>
    • <?php endforeach; ?>

    </div>

    </div>

    http://wordpress.org/extend/plugins/my-posts-order/

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

    @kapilchugh

    Hi,

    Thank you so much.

    As far as related links are concerend, we normally display other posts in the same category. I don’t think you can do with this plugin.

    But if you want to display some featured posts category wise, then you can create multple sections by assigning section name same as category name and pass those names in query_posts like this

    <?php query_posts('section_name=cat1') ?>

    Thank you Kapil for your response!

    Did I understand it right, it is not possible to order the article links from the same section on the sidebar?
    You can only sort the articles but not the related article links for the sidebar on the same section/category?

    Thanks a lot 🙂

    Plugin Author Kapil Chugh

    @kapilchugh

    Now you have created doubt in my mind 🙂

    It would be great if you could please expain your problem(specially related links) again in detail along with your site URL(if you can share)

    Sorry for inconvenience.

    Thank you I really appreciate your help 🙂

    You can find a picture with details of my problem here:
    http://www.abload.de/img/mypostorderinfzz.jpg

    The articles on the left side are already working with your my post order plugin by adding <?php query_posts(‘section_name=Offers’) ?> before the code <?php if ( have_posts() ) : ?>.

    Now my problem:
    I want that these Articles, on the left side in the content area, should also show up on the right side, next to the articles, but not the whole post, only the links to the articles of this section.

    I hope I could explain it a bit better now, if not I can try to give more info 🙂

    Thank you so much again Kapil

    Plugin Author Kapil Chugh

    @kapilchugh

    Pleasure is always mine 🙂

    In RHS you need to do the same thing. For eg.

    <ul>
       <?php
    									global $post;
    									$args = array( 'section_name' => 'Offers' );
    									$myposts = get_posts( $args );
    									foreach( $myposts as $post ) :	setup_postdata($post); ?>
    <li><a><?php the_title(); ?></a></li>
    								<?php endforeach; ?>
    </ul>

    Feel free to revert back.

    Thank you Kapil!

    If I’m changing your suggestion:

    $args = array( ‘numberposts’ => 10, ‘offset’=> 1, ‘category’ => 8 );
    to
    $args = array( ‘section_name’ => ‘Offers’ );

    it just displays ALL the latest created Posts in wordpress, no matter what category/section I’m using for section_name. Sadly it doesn’t take the section-posts.

    Do you know what the problem is?

    Thank you

    Plugin Author Kapil Chugh

    @kapilchugh

    So there must be 2 loops on your page. One on the LHS on main content area and 2nd in the sidebar.

    Ideally speaking, it should work now.

    Have you put wp_reset_query(); after your loop.

    Sorry for the late response.

    How should I put 2 loops on the page. I have at the moment one file called loop.php with the content:

    Where should I put wp_reset_query(); ?

    Thank you again 🙂

    Plugin Author Kapil Chugh

    @kapilchugh

    No, you need to put wp_reset_query in your theme after while loop.

    Or

    You can send me your index.php and sidebar.php file. I’ll check it.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: My Post Order] Sorting for sidebar’ is closed to new replies.
Skip to toolbar