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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:34:48+00:00 2026-05-18T00:34:48+00:00

Scenario: I am creating collapsible panels in the sidebar and displaying ALL categories as

  • 0

Scenario: I am creating collapsible panels in the sidebar and displaying ALL categories as DIVs and all Posts links in those category DIVs. Simple enough. I got all categories by get_categories('orderby=name&order=ASC') and now looping through every category to get ALL posts in each category.

Problem: The code get_posts('nopaging=1&category='.$category->cat_ID) gives me all posts but WITH content and other things too. All, I want is the permalink of the post. That’s it. I believe using get_posts will thus create big overhead as there are around 1000 posts in over 20 categories.

Solution: A function or piece of code that can just get me all the posts in a category with permalink and without other stuff, especially content as it’s the largest overhead.

  • 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-18T00:34:49+00:00Added an answer on May 18, 2026 at 12:34 am

    Look into using a custom query to extract exactly what you want: http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query

    You may want to also use wp_reset_query() after you’ve finished with your custom call because selecting a query can be a fun Gotcha in wordpress when things start overriding each other: http://codex.wordpress.org/Function_Reference/wp_reset_query

    Edited after your comment: You’d need to be using a join between wp_term_relationships and wp_posts, possibly even a 3-way join with wp_term_taxonomy thrown in for good measure.

    To be absolutely honest, I wouldn’t even bother – it’s a lot of work for not a lot of benefit. 1000 records isn’t really that much, and WordPress already uses indexes on wp_posts to optimise its’ queries. You’d probably get much better results through using the wp super cache plugin to generate static HTML files for visitors ( http://wordpress.org/extend/plugins/wp-super-cache/ ) than by duplicating core WP queries with a handful of columns removed from the select.

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

Sidebar

Related Questions

Detailed scenario is like this : I am creating 10 buttons using a loop
I have a scenario that, I am creating dynamic html content and I need
I'm running into the classic scenario where, when creating Word COM objects in .NET
Scenario: Creating some web service as @Stateless bean, package it as ejb jar. Result
Scenario : Creating a server which has Room objects which contain User objects. I
Goal: I want to use jsf`s i18n Scenario: creating resource bundle (utf-8) file info:
Here's my scenario: I'm creating a password change page. the real field that holds
My scenario..Im using SqlCompactServer Edition .I'm creating table Create Table SSr( name nvarchar(400),id int
I have a scenario where I am going to be creating a large number
I am creating a mail like scenario where a user has a next and

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.