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 4048486
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:49:24+00:00 2026-05-20T13:49:24+00:00

To explain further, I need to get a page to display posts from a

  • 0

To explain further, I need to get a page to display posts from a specific category. I want to automate this process so I don’t have to make a template for each category. How would I do that? (keep in mind the person I’m building this is for has no coding experience.)

The only way I could think off from the top of my head is to use the title or slug. So if the category is named the same thing as the slug, could I filter by category using the slug? Maybe this isn’t the best way… what should I do?

This is what I came up with, but it doesn’t work, I’m sure due to improper use on may part, but I’ve been pouring over the WP codex and Google with no avail to tell me my problem.

<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args= array(
    'orderby' => 'date',
    'order' => 'ASC',
    'paged' => $paged,
    'category_name' => echo the_title('\'','\'',)
);
query_posts($args);
?>
  • 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-05-20T13:49:25+00:00Added an answer on May 20, 2026 at 1:49 pm

    This ended up working:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $page_slug = $post->post_name;
    $args= array(
        'orderby' => 'date',
        'order' => 'ASC',
        'paged' => $paged
    );
    query_posts($args);
    query_posts( 'category_name=' . $page_slug );
    ?>
    

    for those of you with the same question.

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

Sidebar

Related Questions

I'm quoting myself on a previous question I asked to further explain: I'm trying
Let me try to explain what I need. I have a server that is
Let me explain: this is path to this folder: > www.my_site.com/images And images are
Explain why a nullable int can't be assigned the value of null e.g int?
Please explain to me why the very last echo statement is blank? I expect
Can someone explain the mechanics of a jump table and why is would be
Could anybody explain in plain words how Cloud computing works? I have read the
How would you explain JavaScript closures to someone with a knowledge of the concepts
Can someone explain to me the advantages of using an IOC container over simply
Can you explain STA and MTA in your own words? Also, what are apartment

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.