Get_the_title returning ID only?
-
Noobie question I suppose. I’ve got a custom page template (using Thesis) that is trying to grab recent posts:
foreach($lastposts as $post) : setup_postdata($post); $post_id = $post->ID; $post_date = get_the_date($post_id); $post_title = get_the_title($post_id); $post_url = get_permalink($post_id); $post_excerpt = get_n_char_excerpt($GLOBALS['blogright_excerpt_length'], $post->post_content); ?> <li><span class="storydate"><?php echo $post_date ?></span><span class="storytitle"><a title="<?php echo $post_title ?>" rel="nofollow" href="<?php echo $post_url ?>"><?php echo $post_title ?></a></span></li> <?php if ($current_article_num < $article_count) $current_article_num++ ; endforeach;
The “$post_title = get_the_title($post_id);” is returning a number (a post ID?). I want to format the date as “Month Day, Year”.
I tried using “post_date = get_the_date($post_id);” and it returns a date with *everything* (e.g. 2011-09-22 15:02:15).
Any ideas on how I can get what I want: “Day Date, Year” format?
Thanks in advance,
David
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Get_the_title returning ID only?’ is closed to new replies.