If you wish to hard code it into the templates you can us WP_Query (http://codex.wordpress.org/Function_Reference/WP_Query) inside any php file in your themes folder. Here is an example of it in practice:
<?php
$args=array(
'cat' => 1
);
$the_query = new WP_Query($args);
while ($the_query->have_posts()) : $the_query->the_post();
?>
<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
<?php
endwhile;
?>
For a full list of options you can put inside the array i recommend checking out query_posts (http://codex.wordpress.org/Function_Reference/query_posts).
You can use this code inside the admin but it requires a plugin to enable you to process php inside a post called exec-php (http://wordpress.org/extend/plugins/exec-php/).
Thanks
Dave.
Hi Dave,
Thanks for that! I have got the plugin installed and the code on the page, and although it works it creates a list of posts in a category rather than show the posts in full.
Is this due to the php code above of the css styling of a theme?
Thanks again for your help.
Hello again,
In this instance you can modify anything inside the while() to suit what you wish to display. You can using any tags you would see in the template files such as the_permalink, the_title, the_excerpt, the_content, the_date, the_time. In your Instance I think you’re looking for something similar to the below.
<?php
$args=array(
'cat' => 1
);
$the_query = new WP_Query($args);
while ($the_query->have_posts()) : $the_query->the_post();
?>
<div class="post">
<h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<?php the_content(); ?>
</div>
<?php
endwhile;
?>
You can checkout the following links for more information about templating.
http://codex.wordpress.org/The_Loop
http://codex.wordpress.org/Stepping_Into_Templates
http://codex.wordpress.org/Template_Tags
Thanks
Dave.
Thanks for the quick reply Dave. I will give it ago over the next day or too.
Cheers buddy,
Jayce
Just one little quicky!!!!
Using the code above works, but it puts the full posts in the section. Is it possible to selct category instead so it shows the overview (don’t really know what to call it).
IE
If I click on a category in the widget it takes me to a category overview with the posts in a short format below that. I can then click on a post to view the full version.
Hope this makes sense.
Jayce
*UPDATE*
It does show all posts in a certain category but it shows the entire post instead of the normal way..
http://phototraining(.)tv/news
This is the normal styling.
http://phototraining(.)tv/testpage
This is using the code Dave supplied
use <?php the_excerpt() ?> instead of <?php the_content() ?>
@dave
Thanks for this buddy, it works a treat!!!
@chinmoy
Thank you for the addition, that also worked.
Jayce
chinmoy29
Hi!Sorry that I’m writing not related text,but I really need your help!)I didn’t know how to contact with you..Can you please reply to my question on my topic at
http://wordpress.org/support/topic/make-div-on-static-page-for-latest-post?replies=7
Thank you very much!