Custom Post Display

Опис

You can use the Custom Post Display plugin to display the contents of any custom post type in your WordPress site, either as a widget or anywhere in your content using a shortcode.

Features include:

  • Widget and [custom_post_display] shortcode for placing anywhere (including the block editor via the Shortcode block)
  • Options to order by Post Title, Date and Menu Order
  • Inclusion of Featured Image with centered, left or right alignment
  • Customize number of posts displayed
  • Specify number of words per post excerpt

More information and a demo can be found at my site.

Скріншоти

Встановлення

  1. Download and unzip the file.
  2. Upload the Custom Post Display folder to your WordPress plugins folder
  3. Log in to WordPress and go to Plugins
  4. Click on the Activate link for Custom Post Display.
  5. Go to Appearance > Widgets and add the Custom Post Display widget to your sidebar, or use the [custom_post_display] shortcode in any post or page.

Часті питання

Can I use this widget for Posts and Pages?

Yes, you have the option to choose Posts or Pages when you choose a custom post type. You can actually just use this widget to display recent posts or pages.

How do I use the shortcode?

Add [custom_post_display] to any post or page. You can pass options, for example:

[custom_post_display posttype="product" postnum="5" postlength="20" byorder="name" sorter="ASC" show_image="1" image_pos="left" moretext="Read more"]

Available attributes: posttype, postnum, postlength, byorder (empty for date, menu_order, or name), sorter (ASC or DESC), show_image (1 or 0), image_pos (centered, left, right) and moretext.

Can I choose which posts to feature?

Yes, if you have the Page Attributes box enabled for your custom post type (or Post/Page), when you edit that post, just enter a number in the Order box.
Number your posts according to the order you want them to appear, then, in the Widget options, just choose ‘Menu Order’ in the ‘Order By’ field and choose your Sort order.

Відгуки

12.08.2026
Easy way to show custom posts on the site. Works well for what I need it to do.
03.09.2016
Works well for my site. Hope you have an additional feature to use a shortcode instead of a widget.
03.09.2016
Needed a plugin to display the custom posts in a widget for a project I have and this one works like a charm.
Прочитати всі 5 відгуків

Учасники та розробники

“Custom Post Display” — проект з відкритим вихідним кодом. В розвиток плагіну внесли свій вклад наступні учасники:

Учасники

Перекладіть “Custom Post Display” на вашу мову.

Цікавитесь розробкою?

Перегляньте код, перегляньте сховище SVN або підпишіться на журнал розробки за допомогою RSS.

Журнал змін

2.0.0

  • Compatibility rewrite for modern WordPress and PHP 8
  • Fixed fatal error on PHP 8 by removing create_function()
  • Replaced the deprecated PHP4-style widget constructor with __construct()
  • Added a [custom_post_display] shortcode so the plugin works in post content and the block editor, not just widget areas
  • Escaped all output and sanitized all saved options
  • Replaced a direct database query with get_post_types()
  • Added direct-access protection and internationalization
  • Confirmed compatibility with WordPress 7.0

1.2

  • Replaced deprecated WP Widgets construct
  • Added option for thumbnail alignment

1.1

  • Fixed issue with missing word trimmer function

1.0

  • Initial release