query from content

List custom search results for posts, pages and custom post types inside your post content via shortcode and WP_Query.

Author:Brandon Buster (profile at wordpress.org)
WordPress version required:3.0
WordPress version tested:3.4.2
Plugin version:0.0
Added to WordPress repository:30-09-2012
Last updated:01-10-2012
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:0
Rated by:0
Plugin URI:
Total downloads:1 158
Active installs:10+
plugin download
Click to start download

Query from Content (QFC) is a simple shortcode plugin that allows you to target exactly the posts you're looking for and list them in your post content. Further, you can specify your own header, include your current CSS styles to format the list, specify the number of results, and even display thumbnails and excerpts.

The most basic format of QFC shortcode would look like:

[qfc]Here is a Basic List[/qfc]

The above shortcode would output a header reading "Here is a Basic List", below the header would be included your five latest posts, no formatting, no excerpt, no featured image. To customize your results, we can tell QFC to add some CSS as well as the posts' images and excerpts. That shortcode should be placed inside your post content like so:

[qfc class="some-example-class" id="some-example-id" image="yes" excerpt="yes"]Some Bells and Whistles![/qfc]

Also, you can choose to add more than one CSS class or id to your results by adding id's and classes using a comma seperated list:

[qfc class="some-example-class, another-class" id="some-example-id, another-id" ]We Like CSS![/qfc]

The Query from Content Shortcode can list more than just your most recent blog posts. You can specify tags, categories, post author, pages and even custom post types.

Here's another quick example. This one specifies a tag, a category, and an author:

[qfc category_name="Italian-recipes" tag="lasagna" author_name="Luigi"]Luigi's Fantastico Lasanga Recipes![/qfc]

QFC reads the shortcode and passes the category, tag and author to the WP_Query class. If you are familiar with WP_Query, you'll recognize the QFC code matches exactly the parameters used with WP_Query. For more advanced users, QFC allows you dynamic access to all the most popular search features provided by WP_Query, just make sure the parameters you enter into the QFC shortcode match the exact spelling of WP_Query parameters.

For more infomation on advanced usage of the Query From Content Shortcode plugin, visit the WordPress codex page for WP_Query.