How to create & add Meta Query in Elementor Loop Grid / Post Grid

Поделиться
HTML-код
  • Опубликовано: 22 июн 2024
  • How to filter posts in Elementor loop grid using meta query
    ----------------------------------------------------------------------------------
    I have included the PHP code in the first comment
    -----------------------------------------------------------------------------------
    Facebook: / panthoprodhanofficial
    LinkedIn: / pantho-prodhan
    Instagram: / instapantho
    Website: panthoprodhan.com/
    -----------------------------------------------------------------------------------
    Thanks for watching! If you enjoyed the video, please give it a thumbs up, drop a comment, and remember to subscribe!
    -----------------------------------------------------------------------------------
    For business and other inquiries:
    pantho@panthoprodhan.com
    #elementor
    #elementordynamiccontent
    #elementortutorial
    #wordpress
    #webdesign
  • НаукаНаука

Комментарии • 4

  • @PanthoProdhan
    @PanthoProdhan  23 дня назад +1

    Custom Code for Meta Query:
    function my_query_by_post_meta( $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' => 'project_type',
    'value' => [ 'design', 'development' ],
    'compare' => 'in',
    ];
    $query->set( 'meta_query', $meta_query );
    }
    add_action( 'elementor/query/{$query_id}', 'my_query_by_post_meta' );

  • @kasimmuhd5119
    @kasimmuhd5119 23 дня назад

    Good job am in your last video on crocoblock can you create an admin dashboard where he can remove, add, or delete post from front end

    • @PanthoProdhan
      @PanthoProdhan  23 дня назад +1

      I will

    • @kasimmuhd5119
      @kasimmuhd5119 23 дня назад

      @@PanthoProdhan i am follow ur video and doing what u are doing