twentyfifteen-rtl.css
7 years ago
twentyfifteen.css
1 year ago
twentyfifteen.php
1 year ago
twentyfourteen-rtl.css
7 years ago
twentyfourteen.css
1 year ago
twentyfourteen.php
1 year ago
twentynineteen-rtl.css
2 years ago
twentynineteen.css
1 year ago
twentynineteen.php
1 year ago
twentysixteen-rtl.css
3 years ago
twentysixteen.css
1 year ago
twentysixteen.php
1 year ago
twentytwenty-rtl.css
2 years ago
twentytwenty.css
1 year ago
twentytwenty.php
1 year ago
twentytwentyone-rtl.css
2 years ago
twentytwentyone.css
1 year ago
twentytwentyone.php
1 year ago
twentysixteen.php
49 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Jetpack Compatibility File |
| 4 | * See: https://jetpack.com/ |
| 5 | * |
| 6 | * @package automattic/jetpack |
| 7 | */ |
| 8 | |
| 9 | /** |
| 10 | * Enqueue Jetpack compat styles for Twenty Sixteen. |
| 11 | */ |
| 12 | function twentysixteen_init_jetpack() { |
| 13 | /** |
| 14 | * Add our compat CSS file for custom widget stylings and such. |
| 15 | * Set the version equal to filemtime for development builds, and the JETPACK__VERSION for production |
| 16 | * or skip it entirely for wpcom. |
| 17 | */ |
| 18 | if ( ! is_admin() ) { |
| 19 | $version = false; |
| 20 | if ( method_exists( 'Jetpack', 'is_development_version' ) ) { |
| 21 | $version = Jetpack::is_development_version() ? filemtime( plugin_dir_path( __FILE__ ) . 'twentysixteen.css' ) : JETPACK__VERSION; |
| 22 | } |
| 23 | wp_enqueue_style( 'twentysixteen-jetpack', plugins_url( 'twentysixteen.css', __FILE__ ), array(), $version ); |
| 24 | wp_style_add_data( 'twentysixteen-jetpack', 'rtl', 'replace' ); |
| 25 | } |
| 26 | } |
| 27 | add_action( 'init', 'twentysixteen_init_jetpack' ); |
| 28 | |
| 29 | /** |
| 30 | * Alter gallery widget default width. |
| 31 | */ |
| 32 | function twentysixteen_gallery_widget_content_width() { |
| 33 | return 390; |
| 34 | } |
| 35 | add_filter( 'gallery_widget_content_width', 'twentysixteen_gallery_widget_content_width' ); |
| 36 | |
| 37 | /** |
| 38 | * Remove ratings from excerpts that are used as intro on blog index, single, and archive pages. |
| 39 | */ |
| 40 | function twentysixteen_remove_share() { |
| 41 | if ( is_single() || is_archive() || is_home() ) { |
| 42 | remove_filter( 'the_excerpt', 'sharing_display', 19 ); |
| 43 | if ( class_exists( 'Jetpack_Likes' ) ) { |
| 44 | remove_filter( 'the_excerpt', array( Jetpack_Likes::init(), 'post_likes' ), 30 ); |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | add_action( 'loop_start', 'twentysixteen_remove_share' ); |
| 49 |