Support » Networking WordPress » Post order in Multisite

  • Resolved Anna1615


    Please let me know how to set up the post order in multisite so the most recent post shows first. It should not be difficult but for some reason I cannot do this.

    Here’s my site:

    Many thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • There is no specific setting to affect post order in the multisite Network Dashboard. Dashboard->Settings->Reading to toggle static page or posts display on your site’s home page.

    Anything can happen with a theme or plugin add-on, however.

    In your theme, the loop can be manipulated to do whatever the WP_Query parameters will allow.

    You may also want to search for a plugin to do what you like to the WP_Query as well.

    Thanks David, I’ll give your suggestions a try and report back on the results.

    Apparently, the default is descending order in WP — ie, most recent post first. — I don’t understand why my multisite is posting in ascending order. I am using a twenty-twelve child theme. The plugin I’ve tried (Post Type Order) does not change the order of the posts.

    I think I know what happened. — I removed the default navigation from the header and hard coded in my own navigation. This may have effected the order of the posts.

    The issue is not likely related to my removing the default navigation. — I can get posts to appear in DESC order. But only if the Landing Page is posts (and not a static page).

    I’ve added the following code to the index.php of my child theme.

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    $query = new WP_Query( array ( ‘orderby’ => ‘title’, ‘order’ => ‘DESC’ ) );

    <?php endwhile; else: ?>
    <p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
    <?php endif; ?>

    The site did not break but the issue is not resolved.

    Anyway, whatever you are up to with the loop so far is not specific to multisite. You may find more help in the themes and templates forums rather than multisite for your theme designing.

    You say, “I can get posts to appear in DESC order. But only if the Landing Page is posts”
    That is the way it is supposed to work(DESC by post date) Landing on a static page does exactly that -display one page.

    Your index.php snippet:
    Adding a “$query” var, and then doing nothing with the var of course does nothing.
    Perhaps syntax like the following would make more sense:

    <?php $query = new WP_Query( array ( 'orderby' => 'title', 'order' => 'DESC' ) ); ?>
    <?php while ($query->have_posts()) : $query->the_post(); ?>
      <!-- Do stuff... -->
    <?php endwhile; ?>

    (Your snippet loop above descends by alphabetical order descending Z-A by the way).

    At any rate, editing the index.php – if your parent theme has a static page template “page.php” in the template hierarchy – indeed does nothing. You need to figure out which template page you are viewing your static page with and edit there.

    For example, a twentytwelve child theme would display a page using the loop found on the “page.php” – so the child theme would need edits to a corresponding “page.php” (or “content-page.php” if you are editing the Loop only and “front-page.php” if landing on the front page).

    I found the solution : Create a — page — called Blog and add it to your menu. Then in the WP dashboard designate the Blog page as your Posts page.

    @david, thanks for all your help. Your php skills are a great resource. I’d like to learn how to create a custom template. Could you point me to some resources/tutorials in hopefully plain English on how to build a custom template.

    Many thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Post order in Multisite’ is closed to new replies.