Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8537437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:54:06+00:00 2026-06-11T10:54:06+00:00

I have a page that lists all posts with a certain category news. The

  • 0

I have a page that lists all posts with a certain category “news”. The first result is always itself – the page! The page doesn’t even have a category but for some reason is listed as one. I only want to retrieve ‘posts’.

My query is:

query_posts( array ( 'category_name' => 'news', 'posts_per_page' => 4, 'orderby' => 'date', 'order' => 'ASC', 'post_type' => 'post' ) );

The resulting page can be seen here:

http://vl.social-gamer.com/news-blog/

I appreciate any help. I’m a bit of a WP noob still.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:54:07+00:00Added an answer on June 11, 2026 at 10:54 am

    If what you’re trying to do is just get a list of categories, then I’d suggest a function already inside of WordPress called wp_list_categories(). Here’s the documentation on that particular function.

    Displays a list of Categories as links. When a Category link is
    clicked, all the posts in that Category will display on a Category
    Page using the appropriate Category Template dictated by the Template
    Hierarchy rules.

    Keep in mind, this will also echo out the categories, not just retrieve them. I find myself using this function quite often:

    <?php wp_list_categories('title_li='); ?>
    

    However, if you’re looking to find just the “posts” of a certain category and not the “pages” as well then understand that pages in WordPress are nearly the same thing as posts in WordPress. Pages for one can’t have a category, but posts can. Posts are sorted by date, and pages are not. There’s some discrepancies, but for all intents and purposes, there’s not a huge difference in how you should code between the two. Here’s some more information on that discussion.

    EDIT

    The author of the post appears to have this problem due to an improper file structure. For references to a good fule structure please see this link.

    index.php
    header.php
    sidebar.php
    footer.php
    functions.php
    style.css
    page.php <– This isn’t in the article from the link, but it should be added to decide between a page layout of a page of posts layout.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that lists all from my Post table, it looks like
I have a HAML page that lists some links to delete things that looks
I have a page (below) that has a datagrid that lists item's returned from
I have a page that, depending on input from a previous page, lists a
I have a code that lists all files in a dir. The code looks
I have a simple blog page - a list of posts that each consist
In WordPress, how can I select all posts in a certain category (custom taxonomy),
I have a page (index.php) that pulls posts from mysql database. The posts are
I have a page that displays a list with a of elements with a
I have a page that displays a list of tickets. On each of these

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.