WordPress.org

Ready to get started?Download WordPress

Forums

Requests about Sticky posts (3 posts)

  1. catiakitahara
    Member
    Posted 5 years ago #

    Hi, guys,

    I think it would be nice to add a class to the sticky posts, so we can give it a different style.

    Other thing is that this option is too hidden in the "add new post page", it wasn't easy to find. I wasn't the only one with this same difficulty.

  2. Charles Frees-Melvin
    Member
    Posted 5 years ago #

    In 2.7 Classic and Default templates it was changed but if your not using them in your index.php/archive.php/(and any other post list templates)

    Find:

    <div class="post" id="post-<?php the_ID(); ?>">

    an add "<?php sticky_class(); ?>" as so:

    <div class="post<?php sticky_class(); ?>" id="post-<?php the_ID(); ?>">

  3. catiakitahara
    Member
    Posted 5 years ago #

    Thanks, I wasn't aware of that. And I discovered too that now there's a new function called post_class() which adds classes to the element where the post is in. For those who had the same question look at these codex informations.

Topic Closed

This topic has been closed to new replies.

About this Topic