Skip Navigation

[Resolved] Using CSS to shorten the [wpv-post-link]

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 1 year, 2 months ago.

Assisted by: Minesh.

Author
Posts
#2702218

Tell us what you are trying to do?

I've a loop item view that shows details of a walk. Visible on hidden link - currently displays a number of tours. Each loop item contains
- a post link [wpv-post-link]
- a date field
- a picture
- guide name
- price of tour
- extract of post text
- and a book here link

All this is pretty good - but the length of the post link varies and this means images and other aspects of the post fail to align across the loop.

What I want to do is to either
(a) only show [wpv-post-link] on one line, truncating any overflow
or
(b) show all [wpv-post-link] titles as two lines (even if they are only one line in length), truncating any overflows

I'm guessing that it should be possible to do something use CSS. I'm rather handicapped by not knowing much about CSS, but am I right in thinking that the approach would be something like using

[wpv-post-link style="truncate-line"]
and defining "truncate-line" in the css-editor box using something like:
.truncate-line{
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
}

I've had a go at this, but it doesn't seem to work. My effort is
[Edit Content Template “Loop item in view walks public aligned” ‹ Westminster Guides — WordPress](hidden link)

Is there any documentation that you are following?

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-link
hidden link
hidden link

#2702339

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I think its not required as I can see you are using bootstrap and the bootstrap column class you are using is col-sm-4 and it does make three equal columns per row and if you try to add more text to any of anchor tag (post link) it will automatically do want you want.

I suggest you should adjust the display of your images and other things and try to add it in the center of the column and check if that improves the layout a bit or I suggest you can ask help and try to find out CSS pro who can help you in this regard.

More info:
- https://toolset.com/documentation/legacy-features/views-plugin/view-layouts-101/#bootstrap