Support » Theme: MH Magazine lite » How to display the most recently updated post on the top?

  • Resolved ganesh79

    (@ganesh79)


    Dear Sir,
    I want to know how to display the most updated post on the top of the page.

    waiting for your guide.

    Thank you

    Ganesh

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi Ganesh,

    thanks for using MH Magazine lite.

    It depends on how you’ve configured your front page. If you’re showing your latest posts on the front page (Posts page), then the latest post will be displayed on top out of the box. Unless you’ve made posts sticky.

    If you’ve configured your site to have a static front page with widgets, like instructed in the theme documentation, then it of course depends on how you’ve placed your widgets and what content you’re filtering through these widgets.

    thanks for your msg.
    i am asking this for other pages. for example , i have a page job…there i have many post.one of the post is “IT jobs”..if i update this IT post..it should come in top of the page.

    how can i do that

    • This reply was modified 2 years, 3 months ago by  ganesh79.

    thanks for your msg.
    i am asking this for other pages. for example , i have a page job…there is have many post.one of the post is “IT jobs”..if i update this IT post..it should come in top of the page.

    how can i do that

    You may want to look into category archives. Just create a category “IT Jobs” and then whenever you post an article from the “IT Jobs” category, it will appear on top of the particular category archive.

    Here you can learn more:

    And if you want that a previously published post will be on top again, then just update the date of the post because archives are sorted chronologically.

    hi,
    i found this below coding for listing the updated file..but i dont know where to add this code..can u help me

    <?php
    $today = current_time(‘mysql’, 1);
    $count = 5;
    if ( $recentposts = $wpdb->get_results(“SELECT ID, post_title FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_modified_gmt < ‘$today’ ORDER BY post_modified_gmt DESC LIMIT $count”)):
    ?>
    <h2><?php _e(“Recent Updates”); ?></h2>

      <?php
      foreach ($recentposts as $post) {
      if ($post->post_title == ”) $post->post_title = sprintf(__(‘Post #%s’), $post->ID);
      echo “

    • ID).”‘>”;
      the_title();
      echo ‘
    • ‘;
      }
      ?>

    <?php endif; ?>

    source :- http://crunchify.com/how-to-display-most-recently-updated-postpage-in-wordpress/

    There is no need to deal with code and we can’t offer free assistance with custom development. As mentioned, when you update a post, just update the date as well and the post will appear on top. That’s it.

    ok thank you sir..

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to display the most recently updated post on the top?’ is closed to new replies.