Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Changed WP sticky post class to .wp-sticky #618

Merged
merged 2 commits into from
Dec 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
/** Add Nav Options to Customer */
require_once( 'library/custom-nav.php' );

/** Change WP's sticky post class */
require_once( 'library/sticky-posts.php' );

/** If your site requires protocol relative url's for theme assets, uncomment the line below */
// require_once( 'library/protocol-relative-theme-assets.php' );

Expand Down
19 changes: 19 additions & 0 deletions library/sticky-posts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* Change the class for sticky posts to .wp-sticky to avoid conflicts with Foundation's Sticky plugin
*
* @package WordPress
* @subpackage FoundationPress
* @since FoundationPress 2.2.0
*/

if ( ! function_exists( 'foundationpress_sticky_posts' ) ) :
function foundationpress_sticky_posts( $classes ) {
$classes = array_diff($classes, array('sticky'));
$classes[] = 'wp-sticky';
return $classes;
}
add_filter('post_class','foundationpress_sticky_posts');

endif;
?>