plugin-icon

Simple Subtitles

제작자: Jonathan Desrosiers·
Define a subtitle on any post, page, or custom post type.
등급
5/5
버전
2.1.1
활성화된 설치 항목
30
최근 업데이트일
May 10, 2016

Simple subtitles adds a field on posts, pages, or custom post types for adding a subtitle. Post types can be enabled/disabled in the writing settings section.

There are several functions in the plugin that allow you to easily get subtitles for different contexts. These functions mirror the functions in core for titles.

If you want to display the subtitle in your theme on your own, use the following filter:

<?php function mytheme_disable_subtitle_display( $show ) { return false; } add_filter( 'simple_subtitle_auto', 'mytheme_disable_subtitle_display' ); ?>

By default, only tags are allowed in subtitles (with only class and style attributes). There is a filter this.

<?php function mytheme_simple_subtitle_allowed_html( $allowed ) { $allowed['strong'] = array(); $allowed['div'] = array( 'class' => true, ); return $allowed; } add_filter( 'simple_subtitle_allowed_html', 'mytheme_simple_subtitle_allowed_html' ); ?>

For more info on this, read into the wp_kses functions.

Get the subtitle.

<?php $subtitle = get_the_simple_subtitle( $post_id ); ?>

Display the current post’s subtitle. Should be used within the loop.

<?php $subtitle = the_simple_subtitle( $before = '', $after = '', $echo = true ); ?>

Get the subtitle for use in an HTML attribute.

<?php $args = array( 'before' => '', 'after' => '', 'echo' => true ); $subtitle = the_simple_subtitle_attribute( $args ); ?><h3>Roadmap</h3>

* Add a column in the admin showing subtitles. * Add a setting for selecting the subtitle HTML tag.

무료Business 요금제에서
설치하면 WordPress.com 서비스 약관서드파티 플러그인 약관에 동의하게 됩니다.
테스트된 버전
WordPress 4.5.33
이 플러그인은 다운로드할 수 있으며 에서 사용할 수 있습니다.