Wordpress Meta Query fixture.

進行中 投稿 7年前 着払い
進行中

Using two arrays in a meta query is not working for me, especially when using the value of second array.

If I remove the value of second array or first or both, then it is working, but I need to check two keys.

If the $current_player_name value is present in any of the meta keys, then I need to show the title of the related posts.

Can anybody please tell me the problem of the following code?

<?php

$current_player_name = rwmb_meta( 'pb_select_player_name', '', get_the_ID() );

$args = array(

'post_type' => 'football_fixture',

'meta_query' => array(

'relation' => 'OR',

array(

'key' => 'pb_responsible_home_person',

'value' => $current_player_name

),

array(

'key' => 'pb_responsible_away_person',

'value' => $current_player_name

),

)// meta query end

);//$args end

$player_query = null;

$player_query = new WP_Query($args); ?>

<!-- the loop -->

<?php while ( $player_query->have_posts() ) : $player_query->the_post(); ?>

<ol>

<li><?php the_title(); ?></li>

</ol>

<?php endwhile; ?>

<!-- end of the loop -->

<?php wp_reset_postdata(); ?>

HTML PSDからHTML ウェブサイトのデザイン

プロジェクトID: #11928464

プロジェクトについて

5個の提案 リモートプロジェクト アクティブ 7年前

アワード:

minjurulrahman

hello, I can make your website.I am student of computer science and engineering.I am professional programmer so you can trust [login to view URL] you like you can

$2 USD / 時間
(0レビュー)
0.0

5 人のフリーランサーが、平均$4/時間で、この仕事に入札しています。

karand

Hi there, I have read you project description and understand perfectly what need's to be done. Please feel free to ask questions before awarding the project.

$10 USD / 時間
(152件のレビュー)
5.3
GanpatDesai

Dear Sir/Mam, I am ready to start work immediately. I have been in this industry for 4+ years and such jobs are my daily practice. I can assure that if you will work with me once, you would like to hire me repeate もっと

$3 USD / 時間
(22件のレビュー)
3.9
suklasarker

This is Sukla Sarker. I have enough experience in web design, data entry, web scriping, web research & social media services. So, you can hire me for your project. i will provide my best services for you. I am highly i もっと

$2 USD / 時間
(0件のレビュー)
0.0