Support » Plugin: Pods - Custom Content Types and Fields » Pods, Elementor and Custom Query Filter

  • Resolved edtwodth

    (@edtwodth)


    Hi,

    I have extended post with a new relationsfield (content_type) with options (news, debate, video)

    Now I need to make a $query for use with elementor posts widget.

    How do I right the query if I only wan’t to sho “news”?

    • This topic was modified 4 months ago by edtwodth.
    • This topic was modified 4 months ago by edtwodth.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hello @edtwodth

    Keep in mind that Elementor only partially supports Pods.
    I’m not entirely sure if the Elementor Posts widget supports our relationship fields. If so, it should come up as an option in the query options. You’d have to ask on their support channel to be sure.

    Cheers, Jory

    edtwodth

    (@edtwodth)

    I found the solution:

    add_action( ‘elementor/query/arkiv_nyhed’, function( $query ) {
    $query->set( ‘meta_key’, ‘content_type’ );
    $query->set( ‘meta_value’, ‘news’ );
    } );

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @edtwodth

    That is an interesting solution. Could you share where does the arkiv_nyhed keyword come from? Is that an option within the post widget settings?

    Cheers, Jory

    edtwodth

    (@edtwodth)

    Hi, yes in the query settings of the posts widget

    https://developers.elementor.com/custom-query-filter/

    Plugin Author Jory Hogeveen

    (@keraweb)

    Thanks for sharing!

    Cheers, Jory

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.