Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#33035 closed feature request (wontfix)

Shortcode to pull the posts by post_type

Reported by: achaljain Owned by:
Priority: normal Milestone:
Component: Shortcodes Version: 4.2.2
Severity: normal Keywords:
Cc: Focuses: template

Description

There should be a shortcode to pull the posts or custom posts by it's type. So, instead of writing a custom code using WP_Query in functions.php, we should have a shortcode that would be utilized as follow:

[post type="services" number_of_post=10 order="ASC" orderby="menu_order" caller_get_posts=1]

So, all of the query arguments can be utilized inside this shortcode. It will help a lot to display posts anywhere on the page. We don't need to write a big conditional code even.

Of-course, there should be some plugins for this, but it would be better to have an internal WordPress functionality.

Change History (1)

#1 @swissspidy
11 years ago

  • Milestone Awaiting Review
  • Resolutionwontfix
  • Status newclosed

Hey there

Besides the gallery shortcode WordPress doesn't really provide other built-in shortcodes. And since WP_Query is quite powerful and lots can be done wrong, I'm pretty sure that this isn't something we want to allow using a shortcode. So this really is plugin territory.

Note: See TracTickets for help on using tickets.