Pulling the title and/or content of WordPress posts into each other
Sometimes you just have grab the title or the body of one or more WordPress posts into another one. Instead of just copy pasting the content it had to be live; i.e. changing the original post had to change the one where it was pulled into. This is what I had to do yesterday. I could have built a custom page type just for that one instance, but realized that there must be a plugin for that. That’s how I found Post Content Shortcodes.
It worked perfectly for my purposes, I could grab the title and the excerpt of four posts into another one. You can also set whether to show or not the image form the grabbed post (and if yes, how wide or high it should be), whether to show the whole content of the grabbed post or an excerpt only (and if the latter how many words should that be.) The only part where the description was too cryptic at first was about how to display the title of the grabbed post in this sentence “By default, the title is wrapped in <h2>
tags, but you can use the post-content-shortcodes-title
filter to modify the title output.” But the creator of the plugin, Curtiss Grymala, answered the question of how to use this here.
I know that unnecessary plugins create bloat, but I needed a quick solution. Plus I enjoyed the other shortcode this plugin provides, the one that allows listing of the titles of posts on a page or in a post. (Sidenote: one of the main reason I use Drupal as well, because this is so easy there with the Views. In WordPress it requires custom coding or a plugin like this.) The best part of this shortcode are the option (via arguments). Here are some of the ways the list can be modified
- The number of posts shown
- The starting point in the sequence of posts
- Naming a category to list posts from
- Ordering the list: ascending/descending and by what
- Excerpt’s length
If you need to list a certain types of pages or posts or share content of posts in another one I can recommend this plugin as it worked as advertised.
Recent Comments