Contextual Related Posts includes a shortcode the related posts list. If you’re not familiar with shortcodes, please read this article in the WordPress Codex.

[crp]

This shortcode lets you insert the contextually related posts anywhere in your post content. It takes the following optional attributes:

ParameterTypeDescription
limitIntegerMaximum number of posts to return. The actual number displayed may be lower depending on the category / post exclusion settings.
headingBooleanSet to 0 to disable the heading specified in Title of related posts: under Output options.
show_authorIntegerDisplay the author of the post. 1 to display, 0 to hide.
show_dateBooleanDisplay the published date of the post. 1 to display, 0 to hide.
show_excerptBooleanDisplay the excerpt of the post. 1 to display, 0 to hide.
title_lengthIntegerLimit the length of titles in the display. This sets the maximum number of characters in the title.
offsetIntegerNumber of posts to displace or pass over.
post_typesStringComma-separated list of post types from which to select related posts.
exclude_post_idsStringComma-separated list of post, page or custom post type IDs to exclude from selection.
thumb_sizeStringName of the thumbnail size to display the related posts. This can be the default WordPress media sizes or any custom size set by a theme or plugin. The default size set by Contextual Related Posts is crp_thumbnail.
thumb_widthIntegerWidth of the thumbnail image. This might get overridden if the image of the exact size isn’t found.
thumb_heightIntegerHeight of the thumbnail image. This might get overridden if the image of the exact size isn’t found.
post_thumb_opStringLocation of the post thumbnail. Values: inline, after, text_only, thumbs_only.
link_nofollowBooleanAdd nofollow attribute to links. 1 to add, 0 to exclude.
link_new_windowBooleanAdd _blank attribute to links. 1 to add, 0 to exclude.
daily_rangeIntegerSets the oldest date of related posts (in days).
orderingStringOptions for ordering related posts: relevance, random, date.
same_post_typeBooleanLimit to the same post type. 1 to include, 0 to exclude.
same_authorBooleanLimit to the same post author. 1 to include, 0 to exclude.
include_cat_idsStringComma-separated list of term_taxonomy_id for categories and custom taxonomies. Related posts will only selected from these taxonomies. If you have an older WordPress install, this might differ from the term_id.
include_post_idsStringComma-separated list of post IDs to always include in the selection.
display_only_on_tax_ids (pro only)StringComma-separated list of term_taxonomy_id for categories and custom taxonomies. Limit the display of the related posts to only these taxonomies. If you have an older WordPress install, this might differ from the term_id.

Leave a Reply

Your email address will not be published. Required fields are marked *