• Resolved myers1334

    (@myers1334)


    The Display Post plugin is working perfectly to create a list of all posts matching the parameters, but I cannot get the list to break into columns.

    Basically it’s all one long column, and I want it to be 2 or 3 columns wide.

    I tried adding the columns short code, but I must be doing something wrong.

    My current short code:
    [display-posts posts_per_page=”50″ category=”guide” order=”ASC” orderby=”title” columns=”3″]

    All plugins are up to date, editing with Elementor.

    Any help is appreciated!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    The simplest approach is to use CSS:

    .display-posts-listing { columns: 2; column-gap: 32px; }
    .display-posts-listing li { break-inside: avoid; }
    Thread Starter myers1334

    (@myers1334)

    @billerickson thank you sir, that did get the text to break into columns.
    The width between columns is awkwardly wide for my site though.

    I tried adjusting the 32px in that code down, but no matter how low I take the number it only slightly decreases the width. Adjusting to 30 or 1 both result in the same slight decrease.

    Any input?

    Thanks again!

    Plugin Author Bill Erickson

    (@billerickson)

    The “columns: 2” part tells the browser to make two equal width columns. The “column-gap: 32px” tells the browser to leave 32px of space between the two columns.

    IF you want the columns smaller, you could:
    a) Increase column-gap to a larger number, like 100px
    b) Increase the number of columns (ex: columns: 3; )
    c) Decrease the width of the container. (ex: .display-posts-listing { max-width: 500px; } )

    Thread Starter myers1334

    (@myers1334)

    @billerickson thank you sir. I may not have been clear though – I’m trying to reduce the space BETWEEN columns, not the width of the columns. And reducing the 32px is not working

    Plugin Author Bill Erickson

    (@billerickson)

    If you remove the column-gap property, there will be no space between the columns. If you’re still seeing space between them, it’s likely that your theme is adding padding or margin to the list item. Something like this would help:

    
    .display-posts-listing li {margin: 0; padding: 0; }
    

    I’m sorry but resolving theme-specific CSS issues is beyond the scope of this support channel.

    Thread Starter myers1334

    (@myers1334)

    @billerickson I’m sorry to nag, but I was hoping you help me with one more quirk I can’t seem to resolve.

    My grid is supposed to include two categories of posts.
    I also want it to display all matching posts alphabetically by title – regardless of which of the two categories it comes from. My code is successfully pulling both categories in, but its alphabetizing all of Category 1 then starting over with alphabetizing Category 2. Any help?

    [display-posts posts_per_page=”50″ category=”category-1, category-2″ order=”ASC” orderby=”title”]

    One other question: Is there anyway to get it to color code the displayed text (post title) based upon the category it came from? Like Category 1’s text is blue and Category 2’s text is red? I can’t find anything like that in the guide.`

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Breaking list into columns?’ is closed to new replies.