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

Commit

Permalink
Merge pull request #618 from colin-marshall/sticky-post-fix
Browse files Browse the repository at this point in the history
Changed WP sticky post class to .wp-sticky
  • Loading branch information
olefredrik committed Dec 12, 2015
2 parents fad854b + 9b3b070 commit 775578a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
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;
?>

0 comments on commit 775578a

Please sign in to comment.