WordPress.org

Ready to get started?Download WordPress

Forums

Not recognising post types or stickies (2 posts)

  1. Adam
    Member
    Posted 2 years ago #

    So I have the following code:

    if(is_sticky()){
    	echo "I am a sticky";
    }elseif(has_post_format('aside')){
    	echo "I am an aside";
    }else{
    	echo "I am just content";
    }

    which resides in single.php and it it is obvious what it does. How ever going to a sticky or to a aside ONLY ever echos out "I am just content" when it shouldn't.

    thoughts?

  2. vtxyzzy
    Member
    Posted 2 years ago #

    Is your code inside the Loop?

Topic Closed

This topic has been closed to new replies.

About this Topic