This repository has been archived on 2021-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
biofriction-web/biofriction-theme/library/sticky-posts.php

20 lines
517 B
PHP
Raw Normal View History

2021-02-18 15:27:46 +01:00
<?php
/**
* Change the class for sticky posts to .wp-sticky to avoid conflicts with Foundation's Sticky plugin
*
* @package Biofriction
* @since Biofriction 1.0.0
*/
if ( ! function_exists( 'foundationpress_sticky_posts' ) ) :
function foundationpress_sticky_posts( $classes ) {
if ( in_array( 'sticky', $classes, true ) ) {
$classes = array_diff( $classes, array( 'sticky' ) );
$classes[] = 'wp-sticky';
}
return $classes;
}
add_filter( 'post_class', 'foundationpress_sticky_posts' );
endif;