Buenas, es mi primer post, estoy seguro que no será el ultimo en busca de ayuda, mi problema es que quiero que con un Custom-fields pueda escoger la ID de la categoría, e creado un theme en el cual tengo una pagina y añadiendo un custom-field se muestran los post de la categoría que le indico con el ID, el codigo es este, pero no me funciona.
Creo que el problema esta entre la lineas 3,4,5 con $newID y $post->ID, 'catID', true, aparte me pueden decir si $newID es el nombre de el custom-field o catID
Espero que me puedan ayudar.
< ?php
$temp =
$wp_query;
$wp_query=
null;
$wp_query =
new WP_Query
();
$newID = get_post_meta
($post- >ID,
'catID',
true);
$wp_query- >query
('cat='.
$newID.
'&showposts=10'); ? >
< ?php
while ($my_query- >have_posts
()) :
$my_query- >the_post
();
$do_not_duplicate =
$post- >ID; ? >
< div
class=
"containerCurso" >
< div
class=
"cursBgTop" >
< /div >
< div
class=
"cursBgCenter" >
< h2 ><a>
" rel="bookmark
" title="Permanent
Link to < ?php the_title
(); ? >
" >< ?php the_title(); ? ></a>< /h2 >
< p >< ?php the_excerpt('...'); ? >< /p >
< div class="cursoLista
" >
<ul>
< li class="CursoData
" >< ?php
if(get_post_meta($post- >ID, "feet_value
", true)) :
echo get_post_meta($post- >ID, "feet_value
", true);
else :
echo __('not specified','greenlightpm');
endif; ? >
< li class="CursoIdioma vtip
" title="Este es el < b >idioma< /b > del curso.
" >< ?php
if(get_post_meta($post- >ID, "baths_value
", true)) :
echo get_post_meta($post- >ID, "baths_value
", true);
else :
echo __('not specified','greenlightpm');
endif; ? >
< li class="CursoMapa
" ><img />/img/contenido/banderas/< ?php
if(get_post_meta($post- >ID, "state_value
", true)) {
echo get_post_meta($post- >ID, "state_value
", true);
} else {
echo __('not specified','greenlightpm');
} ? >.png" / >
< li
class=
"CursoDinero" >< ?php
$currency = ts_get_option
('ts_currency');
if($currency ==
'dollar') :
$currency_1 =
"$";
elseif($currency ==
'pound') :
$currency_1 =
"£";
endif;
if($currency ==
'euro') :
$currency_2 =
"€";
elseif($currency ==
'yen') :
$currency_2 =
"¥";
elseif($currency ==
'franken') :
$currency_2 =
" SFr";
endif;
if(get_post_meta
($post- >ID,
"price_value",
true)) {
echo $currency_1.get_post_meta
($post- >ID,
"price_value",
true).
$currency_2;
} else {
echo '<a href="#property-contact">'.__
('Price on request',
'greenlightpm').
'</a>';
} ? >
</ul>
< /div >
< /div >