Beschrijving
Enables an editable description to display on post type archive pages. Show the description with WordPress’s the_archive_description()
function that also displays taxonomy term descriptions. Will work automatically with many themes, including most default WordPress themes.
Translations: Archive descriptions are translatable via Polylang, WPML (affiliate link), and qTranslate-X.
The Events Calendar: The archive description is automatically added above the Events Bar when using the latest templates from The Events Calendar. Filter the location of the description or disable it entirely with the ptad_tribe_template_before_include
filter.
Other Plugins by MRWweb
- MRW Simplified Editor – Get rid of bad and obscure TinyMCE buttons. Move the rest to a single top row.
- Post Status Menu Items – Adds post status links–e.g. “Draft” (7)–to post type admin menus.
- Hawaiian Characters – Adds the correct characters with diacriticals to the WordPress editor Character Map for Hawaiian
Schermafdrukken
Installatie
- Gan naar Plugins > Nieuwe plugin
- Zoek op “Post Type Archiefbeschrijving”
- Klik op “Installeren”
- Klik op “Activeren.”
- Depending on your theme, you may need to add
the_archive_description()
to your templates in order for it to work.
FAQ
-
Is this plugin compatible with WordPress 5.0 / “Gutenberg”?
-
Yes. The plugin does not directly integrate with the post editor screen so no changes were required.
Be aware that as of 5 Dec 2019, it appears the Twenty Nineteen theme will not support post type archive descriptions by default. Unless something changes, you will need to manually add support for them in a child theme if using Twenty Nineteen. See the next FAQ for how to do that.
-
Hoe toon ik een custom post type’s beschrijving?
-
Use
the_archive_description()
orget_the_archive_description()
.Normaal gesproken wil je dit in de
archive-{post_type_slug}.php
ofarchive.php
template bestanden.As of v1.3.0 of this plugin, the archive description is automatically added to The Events Calendar archive pages using the plugin’s latest design.
-
Welke post types krijgen een beschrijving?
-
Standaard elk aangepast bericht type behalve Berichten en Pagina’s die zijn geregistreerd met
'has_archive' => true
. Er is ook een filter (zie hieronder) om ondersteuning toe te voegen voor elk bericht type. -
How do I set up an editable description for my Blog / Posts?
-
Since this plugin does not support descriptions for Posts or Pages, I recommend a different approach.
First make the blog page (aka the “Page for Posts”) editable with this snippet in
functions.php
or anmu-plugin
:add_filter( 'replace_editor', 'ptad_enable_gutenberg_editor_for_blog_page', 10, 2 ); /** * Simulate non-empty content to enable Gutenberg editor on the Blog page * * @param bool $replace Whether to replace the editor. * @param WP_Post $post Post object. * @return bool * * @see https://wordpress.stackexchange.com/a/350563/9844 */ function ptad_enable_gutenberg_editor_for_blog_page( $replace, $post ) { if ( ! $replace && absint( get_option( 'page_for_posts' ) ) === $post->ID && empty( $post->post_content ) ) { // This comment will be removed by Gutenberg since it won't parse into block. $post->post_content = '<!--non-empty-content-->'; } return $replace; }
Then output that content on the blog page with the
home.php
template:echo '<div class="archive-description blog-description">' . apply_filters( 'the_content', get_the_content( null, false, (int) get_option( 'page_for_posts' ) ) ) . '</div>';
-
Are there filters & actions to modify the plugin?
-
Yes. Plenty!
Filters:
ptad_post_types
– geef aan welke post types een beschrijving krijgen (standaard is alle non-built_in post types waarhas_archive
is true)ptad_admin_title
– Pas de titel van de admin-pagina aanptad_admin_parent
– Change parent page of the Description edit pageptad_menu_label
– Pas het menu item label in het admin gedeelte aanptad_description_capability
– Pas de capability m.b.t. wie de beschrijvingen kan bewerken. Standaard:edit_posts
ptad_edit_description_link
– Pas de admin bar link aan om de beschrijving mee te bewerkenptad_view_archive_link
– Pas de admin bar link aan om het post type archief te tonen.ptad_tribe_template_before_include
– Modify which The Events Calendar template part the description should appear before, orfalse
to disable automatic output.
Actions:
ptad_before_editor
– Between title and description editor for ALL admin pages. Receives$post_type
arg.ptad_before_editor_{post_type}
– Between title and description editor for any specific post type.ptad_after_editor
– Immediately below description editor for ALL admin pages. Receives$post_type
arg.ptad_after_editor_{post_type}
– Immediately below description editor for any specific post type.
Beoordelingen
Bijdragers & ontwikkelaars
“Post Type archiefbeschrijvingen” is open source software. De volgende personen hebben bijgedragen aan deze plugin.
Bijdragers“Post Type archiefbeschrijvingen” is vertaald in 5 talen. Dank voor de vertalers voor hun bijdragen.
Vertaal “Post Type archiefbeschrijvingen” naar jouw taal.
Interesse in ontwikkeling?
Bekijk de code, haal de SVN repository op, of abonneer je op het ontwikkellog via RSS.
Changelog
1.5.0 (October 20, 2023)
- Tested up to 6.3
- Adjust the hook which the description is inserted on TEC and make it easier to filter that hook. props @ethanclevenger91
- Applies all WordPress coding standards sniffs (with one small exception that I’m stuck on). Props @mgratch
1.4.0 (June 21, 2022)
- Tested up to 6.0.
- [Fix] The “Edit Archive” admin bar button was broken in the last version. It is now fixed
- [Fix] Prevent error when editing the Description of a post type that contains “-description” in the post type slug. Hilariously edge-casey.
- [Fix] Restore archive description before events bar component in The Events Calendar
- [Dev] Minor code reorganization
- Want a way to edit the blog page? Leave your feedback!