Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

147
Vistas
Elementor custom filter query show post by category and slug

I would like to ask you for your help. What I'm trying to achieve:

I use an elementor. I created a category page template. You can check this on http://estate.romanjelinek.cz/lifestyle . what I'm trying to do is display posts from the Lifestyle and promotion categories on this page. Promotion has two tags (Paid and Unpaid). I need to display first the posts from the category Promotion with the tag Paid (sorted by publication date) and only then all the others (ie together Lifestyle and Promotion with the tag Unpaid). So this is the logie

  1. Promotion Paid
  2. Lifestyle + Promotion Unpaid

Promotion Paid need to be first and no matter the date of publication, you just always have to be ahead of the rest in, if there is no posts in promotion Paid, then only 2)

I tried to use this custom query but doesnt work

// Showing post with meta key filter in Portfolio Widget
add_action( 'elementor/query/my_custom_filter', function( $query ) {
    // Get current meta Query
    $meta_query = $query->get( 'meta_query' );

    // If there is no meta query when this filter runs, it should be initialized as an empty array.
    if ( ! $meta_query ) {
        $meta_query = [];
    }

    // Append our meta query
    $meta_query[] = [
        'key' => #no idea what value there
        'value' => [ 'lifestyle', 'promotion' ],
        'compare' => 'in',
    ];
    $query->set( 'meta_query', $meta_query );
} );

Can u help me with query please?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda