I have these codes :
require_once( dirname(__DIR__) . '/wp-load.php');
foreach ( $ids as $idss ) {
echo get_post_meta($idss, 'IMDB', true);
}
I have search box with form element that search and find all id ( $ids
) of searched word.
I want to print all $ids
's IMDB field.
I can do it on page.php
of the Theme, but I can't do it on header.php
.
I used global $post;
and it did not work.
I have these codes :
require_once( dirname(__DIR__) . '/wp-load.php');
foreach ( $ids as $idss ) {
echo get_post_meta($idss, 'IMDB', true);
}
I have search box with form element that search and find all id ( $ids
) of searched word.
I want to print all $ids
's IMDB field.
I can do it on page.php
of the Theme, but I can't do it on header.php
.
I used global $post;
and it did not work.
Is your $ids
array empty? Echo out each $idss
to see if it contains a value.
foreach ( $ids as $idss ) {
echo $idss . ' <-- ID<br>';
echo get_post_meta( $idss, 'IMDB', true );
}