Forums

choose the ID of the category on a Custom Field (1 post)

  1. danny.saltaren
    Member
    Posted 1 year ago #

    This is my first post, I hope you give me a hand on this matter. I would like to choose the ID of the category on a Custom Field. Once the custom field is done (in a page), I would like to show up the post´s linked to the category chosen (with an ID). I put the ID of the category in the custom field but it doesn´t work at all.

    I think that the problem is between the lines 3, 4, 5. What´s the name of the custom field? newID o catID?

    Thanks in advance

    < ?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 >

Topic Closed

This topic has been closed to new replies.

About this Topic