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

  1. bdd
    Posted 3 years 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.


  2. Bill Erickson
    Plugin Author

    Posted 3 years 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"]


    Then you can use this CSS:

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

  3. bdd
    Posted 3 years 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
    Plugin Author

    Posted 3 years 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. bdd
    Posted 3 years 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

  • Display Posts Shortcode
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic