Hi, I need help with showing categories on pages in post form. I've searched online, there are a ton of things except they don't work for me...
I just copied my index.php file onto a new template, but changed it up and added the code below. However, when I try to add another post that's also in the same category, it doesn't show up. Instead, it just shows one post (I did a test drive and there's only 2 posts and only one post showed). Also, in my page template it displays the title of the Page on each page automatically, so instead of the post title showing, the name of the Page shows for the title.
Possibly there is another code I should be using instead? And how would I fix the other problems I've said above...?
I found the code below on the internet.
<?php
$myposts = get_posts('numberposts=5&category=4');
foreach($myposts as $post) :
setup_postdata($post);
//add in standard WordPress post specific template tags here eg. the_title(), the_permalink, the_content, the_excerpt etc.
endforeach; ?>
Here is my template that I've made: http://pastebin.com/dKhCCUmG
Here is my Page template: http://pastebin.com/zPa6tMms