Support » Fixing WordPress » Recent posts, calling a function "the_category"

  • I use the following code to display the recent posts.

    <?php
      $args = array( 'numberposts' => '5' );
      $recent_posts = wp_get_recent_posts( $args );
      foreach( $recent_posts as $recent ){
      echo '<li>
      <a class="permalink" href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' .   $recent["post_title"].'</a>
      <span class="category">Posted in ??????</span>
            </li> ';
    	}
    ?>

    how to call function “the_category” and use it instead of “??????” ?

    Regards

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Recent posts, calling a function "the_category"’ is closed to new replies.