Turante / sandbox-theme

Automatically exported from code.google.com/p/sandbox-theme
0 stars 0 forks source link

Sticky class not set #162

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make a post sticky
2. Examine the CSS with, say, Firebug
3.

What is the expected output? What do you see instead?
A class of "sticky" should be set, but post has the same classes as a non-
sticky one

What version of the product are you using? On what operating system?
WordPress.com + Sandbox 1.6.1

Please provide any additional information below.
I can get round this by setting a category and testing for, say, "category-
sticky", but then I would have to remove the category if the post ceases 
to be sticky.

Original issue reported on code.google.com by BigDave0...@gmail.com on 16 Sep 2009 at 11:18

GoogleCodeExporter commented 9 years ago
I added support by adding 2 new lines to the functions.php file. The rest of 
the code
around my addition is there for context

// Generates semantic classes for each post DIV element

function sandbox_post_class( $print = true ) {

    global $post, $sandbox_post_alt;

    // hentry for hAtom compliace, gets 'alt' for every other post DIV, describes the
post type and p[n]

    $c = array( 'hentry', "p$sandbox_post_alt", $post->post_type, $post->post_status );

    // Author for the post queried

    $c[] = 'author-' . sanitize_title_with_dashes(strtolower(get_the_author('login')));

    //If post is a sticky post
    if (is_sticky())
        $c[] = 'sticky';

    // Category for the post queried

    foreach ( (array) get_the_category() as $cat )

        $c[] = 'category-' . $cat->slug;

Original comment by TwoVect...@gmail.com on 13 Oct 2009 at 9:38

GoogleCodeExporter commented 9 years ago
TwoVectors - Many thanks for the suggestion, but on WordPress.com we are unable 
to
access the underlying html, hence my plea for a modification.

What I wanted to do was to have a different background for sticky posts.  What 
I have
done is to add "highlight" as a categaory and to test for that in the css,  
This has
the added advantage that I can highlight any post in this way by simply adding a
category.

Blog at http://bigdave44.com/

Original comment by BigDave0...@gmail.com on 20 Nov 2009 at 2:43