WordPress.org

Ready to get started?Download WordPress

Forums

Display Posts Shortcode
[resolved] Styling posts with CSS (5 posts)

  1. bws-online
    Member
    Posted 1 year ago #

    I'm trying to display posts from two different categories on the same page, and need to style the categories differently from one another.

    The entries for the first category each have a thumbnail, a title (linked) and a description.

    The entries for the second list each have a title (linked).

    I saw in another post to use these in CSS to style the title, image, and listing:
    .display-posts-listing .title
    .display-posts-listing img
    .display-posts-listing li

    That worked fine for the individual lists, but is there any way to handle the styling for two different lists (so they don't both have to use the same CSS)?

    Right now I have the first list set up, but then the second list is spaced out way too much (since there are no thumbnails).

    Are there other classes to style as well? (Is there a reference for these somewhere?)

    Thanks for the guidance/assistance.

    http://wordpress.org/extend/plugins/display-posts-shortcode/

  2. Bill Erickson
    Member
    Plugin Author

    Posted 1 year ago #

    The easiest thing to do would be to switch to HTML view and wrap your second one in a div, like this:

    <div class="alternate-styling">

    [display-posts category="xxx"]

    </div>

    Then you can use this CSS:

    .alternate-styling .display-posts-listing .title

  3. bws-online
    Member
    Posted 1 year ago #

    Sounds good in theory, but it's not working.

    I feel like I must be missing something....

    Are there default declarations for the CSS somewhere else that might be overwriting what I'm doing in my child theme style.css?

  4. Bill Erickson
    Member
    Plugin Author

    Posted 1 year ago #

    Display Posts Shortcode comes with no CSS, so it's up to your theme to provide it all. If you provide a link to your site I can see what's not working.

  5. bws-online
    Member
    Posted 1 year ago #

    Thanks. As you've already marked this, we'll consider it resolved at this point.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic