Easily add one or more posts to any page using simple shortcodes. Supports categories, tags, custom post types, custom taxonomies, and more.
Screenshots
Embed a shortcode into a page, and it will automatically pull in the post(s) you need.
Embed shortcode using a Gutenberg shortcode block.
Embed shortcodes directly in your template using do_shortcode
.
FAQ
What is the point of this plugin?
Posts in Page makes it easy to output or embed the posts, pages, or custom post types in any page without modifying WordPress theme templates.
Does it work with Gutenberg?
Absolutely. Just use a Gutenberg Shortcode block or the Classic Edit block to add your shortcode.
Wait! The posts aren’t styled like the posts on the rest of my site.
That is likely true. Currently, Posts in Page doesn’t output any styles; just some basic markup. To change how the posts appear on the page, you’ll need to change the output template.
How do I change the output template?
Simply copy the posts_loop_template.php
to your theme directory and make changes as necessary.
You can even rename it – but make sure to indicate that in the shortcode using the template='my-new-template-name.php'
.
For file housekeeping, you can also create a posts-in-page folder in your theme to store all of your custom templates. It isn’t necessary to specify the posts-in-page folder in your shortcode – Posts in Page will find it automatically.
You can even use multiple templates for use with different shortcodes.
Does it work with custom post types?
Absolutely.
Does it work with custom taxonomies?
You bet.
Will it make me coffee?
Not likely, but let us know if it does; then we’ll know we have something special.
How can I help?
We’d love feedback, issues, pull requests, and ideas on the Posts in Page GitHub repo.
ChangeLog
1.4.4
- Fix issue to prevent fatal errors caused by setting the global query to null.
1.4.3
- Fix issue with missing wrapping pagination div.
- Fix a few
esc_html_e
instances.
1.4.2
- Thanks to Brady Vercher (@bradyvercher) for the thorough code review and fixes.
- Cleanup code to better conform to WP Coding standards and remove legacy cruft.
- PHPCS configuration.
- Update docblock and comments.
- Remove legacy i18n code.
- Escaping output of URLs, translation strings, and more.
- Updated enqueueing to add version for cache busting, add missing jQuery dependency, load admin script in footer.
1.4.1
- Fix wp_reset_query bug
- Patch pagination to make it more reliable across themes.
1.4.0
- Add templates folder to structure and moved default template there.
- Fix pagination issues #42, 59.
- Fix bug preventing including or excluding multiple post_types or categories.
- Add a few new date-based shortcode arguments including
date=
and from_date=
and to_date=
.
- Document post format support, new shortcode arguments.
- Code cleanup.
- Updates to admin page layout and documentation.
1.3.1
- File header housekeeping.
- Code cleanup.
- Fix WPML compatibility issue (thanks @azrall).
- Document new shortcode functions including
exclude_ids
, more_tag
.
1.3.0
- File reorganization / housekeeping.
- Admin UI cleanup.
- Security: Fixed directory traversal vulnerability.
- Added ability to optionally include private posts – Thanks, StarsoftAnalysis!
1.2.4
- now you can set
more_tag=""
to remove the [...] …
that unfortunetly shows up as &hellip
.
1.2.3
1.2.2
- Added pagination, tweaked to turn off by default.
- Bug fixes.
1.2.1
- Added code to allow ignoring, or showing of sticky posts. By default, sticky posts are ignored, but can be re-enabled using the shortcode
[ic_add_posts ignore_sticky_posts='no']
.
1.2.0
- Code maintenance to better comply with standards.
- Added post pagination.
- Plugin now honors default post reading settings under Settings/Reading in the WordPress Dashboard.
- Improved and simplified documentation.
1.1.1
- Code maintenance, fix for category bug, also added the ability for multiple post types per shortcode.
1.1.0
- Code maintenance, squash non-critical debug notices.
1.0.10
- Added check for published/private posts.
1.0.9
- Fixed template bug introduced by comments.
1.0.8
- Code cleanup & indentation.
- Added comments and notes to output template file:
posts_loop_template.php
.
1.0.7
- Added Help Page under Setting in WP Dashboard.
1.0.6
- More plugin housekeeping.
1.0.4
- Minor housekeeping, added author, updated readme.txt.
1.0.3
- Added single post or specific post capabilities.