Skip Navigation

[Resuelto] Highlight post type in a view

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:

I have a view listing all CPTs in a search result. Now I want to highlight one of CPTs using a different border or background. How can I do this?

Solution:

I suggest you try these:

https://toolset.com/forums/topic/highlight-post-type-in-a-view/#post-1361885

Relevant Documentation:

https://wp-types.com/documentation/user-guides/views-shortcodes/#wpv-post-type

This support ticket is created hace 5 años, 1 mes. There's a good chance that you are reading advice that it now obsolete.

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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

Etiquetado: ,

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por PZ hace 5 años, 1 mes.

Asistido por: Luo Yang.

Autor
Mensajes
#1361865

PZ
aaa.png

I have a view listing all CPTs in a search result. Now I want to highlight one of CPTs using a different border or background. How can I do this?

#1361885

Hello,

I suggest you try these:
1) In view's loop, wrap the content with a HTML DIV tag using post type slug as CSS class name, for example:

<div class="[wpv-post-type]">
...
[wpv-post-link]
...
</div>

2) Setup custom CSS codes to add different border or background to those specific post types, for example:

.my-post-type-slug{
background-color: red;
border-style: solid;
}

Please replace "my-post-type-slug" with your custom post type slug.

More help:
enlace oculto

#1361901

PZ

My issue is resolved now. Thank you!