WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#33035 closed feature request (wontfix)

Shortcode to pull the posts by post_type

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

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
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

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.