开发者 |
desrosj
linchpin_agency aware |
---|---|
更新时间 | 2016年5月11日 05:38 |
PHP版本: | 3.5 及以上 |
WordPress版本: | 4.5 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
/wp-content/plugins/simple-subtitles
directory, or install the plugin through the WordPress plugins screen directly.<?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 ); ?>
No one has asked us any questions yet! Use the support link to tell us what is on your mind.