WordPress.org

Ready to get started?Download WordPress

Forums

Different Title Color for todays post (4 posts)

  1. Vajrasar Goswami
    Member
    Posted 2 years ago #

    I post around 10-posts-a-day. My post's title color is Red and now, I want to show 'current' days's post to be of Black and all rest posts to be the usual Red.

    What should I do to achieve the same?

    Thanks.

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    locate the code for the title output, possibly within the loop of index.php and single.php.

    compare the post's publish date with the current date, and add a special css class to the title's element;

    example:

    <h2 class="entry-title<?php if( get_the_time('Y-m-d') == date('Y-m-d') ) echo ' today'; ?>"><?php the_title(); ?></h2>

    then add to style.css:

    .entry-title.today, .entry-title.today a { color: #000; }

    details depend on the used theme - please post a link to your site.

  3. Vajrasar Goswami
    Member
    Posted 2 years ago #

    my site. And am using a genesis framework. So, is it possible to do something in function.php or in hooks to achieve the same ?

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    as genesis framework is a commercial theme, please contact the theme's seller for support with your question.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags