I am trying to get all the ID’s of posts which I have made in a specific category.
I have created a category in WordPress e.g web-articals
.
I have created some posts and linked those with web-articals
category.
Now I want to display the content of post whichI have created inside that category and for that I want all the post ID’s inside that category.
How can I get ID’s off all the post inside of web-articals category?
<?php
query_posts( array ( 'category_name' => 'web articals', 'posts_per_page' => -1, 'order' => ASC ) );
// The Loop
while ( have_posts() ) : the_post(); ?>
<li>
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" ><?php the_title(); ?></a>
</li>
<?php
endwhile;
// Reset Query
wp_reset_query();
?>
I have tried this but dis way of doing it but dis dispalys only the title of the posts in unordered list:
e.g
- Frame Work <—– these are my post titles
- Open Source
- ModelâViewâController (MVC)
but i want somthing which look like
- Frame Work
“content of my post frame works”
- Open Source
” content ofmy post Open Source”
- ModelâViewâController (MVC)
“content of my post”
it works guys here i leave ans for some1 to get help from it.
thanks huys for help
I hope below are the posts of web articals
If it is so, then use
the_ID()
function like you have usedthe_title();
.