ThemeShaper Forums » Thematic

Individual Post Stylings for the Home Page

(9 posts)
  • Started 9 years ago by Deirdre
  • Latest reply from whatsthebigidea
  • This topic is not resolved

Tags:

  1. Deirdre
    Member

    Hi all - I am coding a Wordpresss site for a client who installed Thematic. Everything seems to be going well, but I have run into something that I am unable to resolve. I will try my best to explain what I am looking for:

    The home page will have a total of the last 3 current posts. However, the style for each post is different and are set up like:

    POST1
    POST2 | POST3

    Where the most recent post is in its own style, above the next two recent posts which are side by side.

    I've done a lot of research and have found a few things, but they don't seem entirely relevant to what I need, and ask to edit php functions that I do not see in Thematic's files (such as index.php).

    I may not be searching for the correct term, as this seems like it would be a relatively common need. Also, while I am familiar with certain php functions and code, I am by no means proficient in php.

    Looking at the sourcecode from FF, I notice that post IDs have a class that is listed as .hentry p1, .hentry p2, etc. But CSS doesn't seem to work for these.

    Anyway, is there something I'm missing or does there need to be additional php code?

    Your help is greatly appreciated!

    Sincerely,

    ~Deirdre

    Posted 9 years ago #
  2. Try this in your childthemes style.css and see if it works.

    #content .p1 {background:yellow;}
    #content .p2 {background:red;}
    #content .p3 {background:blue;}
    Posted 9 years ago #
  3. Deirdre
    Member

    Manuel,

    Thanks for replying =)

    I tried the code you suggested and it appears to be working. Thanks so much - and I'll let ya know how it turns out! =)

    Best wishes,

    ~Deirdre

    Posted 9 years ago #
  4. Deirdre
    Member

    Ok so, looks like that works but I have another issue related to it.

    Lets say I want the background of the 1st most recent post to be blue on the homepage. When I click on the title link for that 1st post, I don't want the blue background to carry over to the individual post page - so basically, the styling for the 3 most recent posts on the homepage should be *only* on the homepage. I figure this is possible but I can't seem to locate the styling to differentiate between homepage post stylings and the sub-pages.

    Thanks again,

    ~Deirdre

    Posted 9 years ago #
  5. Deirdre
    Member

    I think I may have figured it out. I went to single.php and renamed the content div to "content2" and it looks like this *may* do what I hope.

    I'll keep posting my progress in case someone else is looking for this info.

    ~Deirdre

    Posted 9 years ago #
  6. amygail
    Member

    Deirdre - Thematic creates dynamic body classes for you.
    This means that you can create different styles like so.. (get the Web Developers extension for Firefox to help you figure out what they are)

    An example would be

    body.home #content .p1 {background:yellow;}

    body.single #content .p1 {background:yellow;}
    body.page #content .p1 {background:yellow;}

    body.page-slug-about #content .p1 {background:yellow;}

    etc...

    Posted 9 years ago #
  7. Deirdre
    Member

    Thanks so much =)

    Posted 9 years ago #
  8. Deirdre
    Member

    Thanks for everyone's help - I have everything up and running as far as the layout and styles of individual post divs.

    Posted 9 years ago #
  9. Dynamic classes. Cool. I knew there was a reason I like thematic. Thanks manuel and amygail!

    Posted 9 years ago #

RSS feed for this topic

Reply

You must log in to post.