Skip to:
Content
Pages
Categories
Search
Top
Bottom

home : different style for first post and others.

  • @grosbouff

    Participant

    Hi,

    in my home.php template, I would like to have a different style for the first post and the others.

    The posts I would like to catch are the posts with a “featured” tag.

    If the user is not logged, I would like to catch also my welcome post (id=3); which is a sticky one.

    That welcome post should be the first to be shown, before the others.

    But I have problems with query_more…

    Here’s what I have :

    function exclude_intro_post() {

    global $query_string;

    if ($query_string)

    $query_more.=‘&’;

    $query_more.=‘tag=featured’;

    if (is_user_logged_in()) {

    $query_more.=‘&caller_get_posts=1’;

    }

    query_posts($query_string . $query_more);

    }

    add_filter(‘bp_before_blog_home’, ‘exclude_intro_post’);

    So it gets the current query string (which is empty for home ?), adds tag=featured to limit it to the “featured” posts; then adds &caller_get_posts=1 if we are logged.

    &caller_get_posts=1 means that the sticky posts are not the first posts shown but are in the normal ordering.

    My problem :

    there are no differences on my home when logged or not logged.

    And the posts are loaded twice.

    I’ve tryed several ways but I can’t do it…

    Could you help please ?

    Thanks !

  • The topic ‘home : different style for first post and others.’ is closed to new replies.
Skip to toolbar