WordPress.org

Forums

[resolved] Post order in Multisite (9 posts)

  1. Anna1615
    Member
    Posted 1 year ago #

    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: http://westend-atelier.ca

    Many thanks

  2. David Sader
    Member
    Posted 1 year ago #

    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.

  3. Anna1615
    Member
    Posted 1 year ago #

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

  4. Anna1615
    Member
    Posted 1 year ago #

    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.

  5. Anna1615
    Member
    Posted 1 year ago #

    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.

  6. Anna1615
    Member
    Posted 1 year ago #

    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.

  7. David Sader
    Member
    Posted 1 year ago #

    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).

  8. Anna1615
    Member
    Posted 1 year ago #

    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.

  9. David Sader
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic