how to get all the id’s of posts made under specific category in wordpress

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.

Read More

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”

Related posts

Leave a Reply

2 comments

  1. it works guys here i leave ans for some1 to get help from it.

        <?php
    
    query_posts( array ( 'category_name' => 'web articals', 'posts_per_page' => -1, 'order' => ASC  ) );
    
    // The Loop
    while ( have_posts() ) : the_post(); ?>
        <!--echo '<li>';
        the_title();
        echo '</li>';-->
        <li>
        <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" ><?php the_title(); ?></a> <?php echo get_post_field('post_content',  the_ID());
    
     ?>
          </li> 
          <?php
    endwhile;
    
    // Reset Query
    wp_reset_query();
    
    ?>
    

    thanks huys for help

  2. I hope below are the posts of web articals

    Frame Work <----- these are my post titles
    Open Source
    Model–View–Controller (MVC)
    

    If it is so, then use the_ID() function like you have used the_title();.