• I’m trying to order posts using AStickyPostOrderER. In my sidebar I have the following code displaying only the posts of the category I’m currently viewing. The plugin is working on my category template (ie. the excerpts are being re-ordered as defined in the AStickyPostOrderER admin area), so I am thinking this piece of code is causing the sidebar list of posts not to re-order. Any suggestions?

    <script src=”https://pastebin.com/embed_js.php?i=WiDhUFSq”></script&gt;

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter surfsup74

    (@surfsup74)

    I’m trying to order posts using AStickyPostOrderER. In my sidebar I have the following code (below) displaying only the posts of the category I’m currently viewing. The AStickyPostOrderER plugin is working on my category template (ie. the excerpts are being re-ordered as defined in the AStickyPostOrderER admin area), so I am thinking this piece of code is causing the sidebar list of posts not to re-order. Any suggestions?

    <?php
    if (is_single( )) {
    $post_ID = $wp_query->posts[0]->ID;
    $all_cats_of_post = get_the_category($post_ID);
    $first_cat_ID = $all_cats_of_post[0]->cat_ID;
    $first_cat_name = $all_cats_of_post[0]->cat_name;
    ?>
    <h2><?php echo $first_cat_name; ?></h2>

      <?php global $post; $cat_posts = get_posts(‘numberposts=100&category=’.$first_cat_ID);
      foreach($cat_posts as $post) : ?>

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

    Thread Starter surfsup74

    (@surfsup74)

    Sorry – I’ve not used pastebin before. The full snippet is here…

    https://wordpress.pastebin.com/WiDhUFSq

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘AStickyPostOrderER not re-ordering sidebar list of posts.’ is closed to new replies.