• Hi there,
    I would like to be able to display the 3 latest posts on an additional page in this format:
    24/07/2004: Latest news title here
    22/07/2004: Latest news title here
    19/07/2004: Latest news title here
    Could someone possibly tell me how I would do this please?
    Many many thanks
    Karl

Viewing 6 replies - 16 through 21 (of 21 total)
  • I take it then that the function is in my-hacks.php and you have the legacy support for my-hacks enabled? If so and it still doesn’t work, try putting the hack function in the index page just to test it.

    I have…. Ok, I will try with putting it in index…

    After putting the actually code in the index.php it worked…
    But just like Karl I would like to have the date thing working as well.. How exactly is the code to look like in order to make it work??
    Mine look like this so far:
    function get_recent_posts($no_posts = 5, $before = ‘

    • ‘, $after = ‘
    • ‘, $show_pass_post = false, $skip_posts = 0) {
      global $wpdb, $tableposts;
      $request = “SELECT ID, post_title FROM $tableposts WHERE post_status = ‘publish’ “;
      if(!$show_pass_post) { $request .= “AND post_password =” “; }
      $request .= “ORDER BY post_date DESC LIMIT $skip_posts, $no_posts”;
      $posts = $wpdb->get_results($request);
      $output = ”;
      foreach ($posts as $post) {
      $post_date = $post->postdate;
      $post_title = stripslashes($post->post_title);
      $permalink = get_permalink($post->ID);
      $output .= $before . ‘‘. $post_date . ” – ” . $post_title . ‘‘ . $after;
      }
      echo $output;
      }
      I think I have done like the it is being told in this thread…

    any? i don’t know much about mySQL so… Could really use some help…

    Anyone?…. I could REALLY use the help!

    Any way that I can make it select only the posts from 1 category, have 2 and it should only show new posts on category 1.

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Post titles on an additional page – How?’ is closed to new replies.