0

I installed bbpress on this morning. I have been slowly integrating it into my worpdress twentyeleven child theme. One thing I am noticing is that the sample sticky posts I created are not receiving the sticky class added to them.

What I’ve done so far is copy over archive-forum, page-topic-tags, sidebar-bb-tagcloud, single-forum, single-topic, single-user and taxonomy-topic-tag into my child theme and formatted the each page to match my existing theme. If i view my site in live preview using the bbpress theme I see that the Sticky class is being applied to the sticky topics. I’m not sure why this isn’t happening using my child theme?

I just noticed that all kinds of classes aren’t being applied to the individual topic rows? Looking at the same page using live preview I see the following classes were applied: post-2019 topic type-topic status-publish hentry odd super-sticky bbp-parent-forum-1998 user-id-1.

Whereas in my child theme I have exactly no classes applied.

Jason Shultz
  • 940
  • 1
  • 19
  • 36

1 Answers1

1

I found the problem. I had a function in my functions.php was malformed. The correct way was this way:

// Add classes to posts
add_filter('post_class', 'my_post_classes');
function my_post_classes( $classes )
{
    $postType = get_post_type();

    if ( $postType == 'post' ) {
        $classes[] = 'clearfix';

    }

    return $classes;
}
Jason Shultz
  • 940
  • 1
  • 19
  • 36