Post Title in PAGE
-
So. I’ve been searching and found a bunch of stuff but my PHP ain’t to strong….
I think I know what I’m doing wrong but don’t know how to fix it…
What I did was I created a PAGE on my wordpress site called TEST.
I added a plug-in which allows me to add PHP to the content of the page…
In the content I added the following:
<?php $args = array( 'numberposts' => 3 ); $lastposts = get_posts( $args ); foreach($lastposts as $post) : setup_postdata($post); ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php endforeach; ?>
I want it to display just the TITLES for my posts…
Now, it does just that…but instead of displaying the proper title it displays :
TEST
TEST
TESTFor the 3 posts that it finds instead of their actual TITLE if I was to go into the post itself.
As a side note…they are links…the 3 above, but they don’t go to the posts..just dead links.
Help
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Post Title in PAGE’ is closed to new replies.