Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter patrickmullins901

    (@patrickmullins901)

    So i’ve updated this to include the name of my relationship field that I’ve extended onto the posts object, is there more to the field name that I’m missing? This isn’t registering as a valid query when referencing it on the front end.

    add_action( ‘elementor/query/custom_q’, function( $query ) {
      $query->set( 'meta_query', array(
            array(
                'key' => 'content_author',
                'value' => get_the_ID(), // The current object ID
            ),
     ));
    });
    Thread Starter patrickmullins901

    (@patrickmullins901)

    @aefmind so if your example, do I need to replace the values of ‘meta_key’ and ‘meta_value’ with something to get this to work? Sorry, I understand HTML/CSS, but PHP is over my head, so I’m struggling with this. Thanks in advance for your help.

    Thread Starter patrickmullins901

    (@patrickmullins901)

    Thank you so much, one follow up questions, as I’m still having a little trouble getting it to work. This is how the code snippets for Elementor are structured to you can call them in the posts widget, see my note below in the code for how to place what you wrote above:

    `add_action( ‘elementor/query/custom-query’, function( $query ) {
    $query->set( ‘post_type’, [ ‘custom-post-type-1’, ‘custom-post-type-2’ ] ); // This is an example query, do I just paste what you’ve provided above in place of this line?
    } );

Viewing 3 replies - 1 through 3 (of 3 total)