Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
$myquery['tax_query'] = array(
    'relation' => 'OR',
    array(
        'taxonomy' => 'brands',
        'terms' => array('ALL'),
        'field' => 'slug',
        ),

    array(
        'taxonomy' => 'media',
        'terms' => array('news', 'events'),
        'field' => 'slug',
        ),
            );

        query_posts($myquery);
             if ( have_posts() ) : while ( have_posts() ) : the_post(); 
                    <div class="so-post-hom">
                        <h2 class="post-title-home"> the_title();</h2><br />
                        <h3 class="post-desc">
                         echo esc_html( get_post_meta( get_the_ID(), 'designers', true ) ); 
                        </h3>
                    <div class="post-bar">

                        $flag=false;
                        $taxonomies = array('brands','media');
                        $show_link = array
                        ('Chac’late','Sukar Pasha Ottoman Lounge','Aspire Grand Café','El Cigar Lounge','Kunafa Albisana',
                        'le Vesuvio','Lwzaar Seafood Market','Shawarma Albisana','Chaclate','news','events');//list any terms in any taxonomy for which to show link
                        foreach($taxonomies as $taxonomy) {
                         $terms = wp_get_post_terms( $post->ID, $taxonomy );
                        foreach($terms as $term) {
                            if( in_array( $term->name, $show_link )) $flag=true;
                            }
                        }
                            if('Red Velvet Cupcakery'==$term->name) echo '<a href="/akh/red-velvet/">Go!</a>';
                            if('Sukar Pasha Ottoman Lounge'==$term->name) echo '<a href="/akh/sukar-pasha-ottoman-lounge/">Go!</a>';
                            if('Aspire Grand Café'==$term->name) echo '<a href="/akh/aspire-grand-cafe/">Go!</a>';
                            if('El Cigar Lounge'==$term->name) echo '<a href="/akh/el-cigar-lounge/">Go!</a>';
                            if('Kunafa Albisana'==$term->name) echo '<a href="/akh/kunafa-shawarma-albisana/">Go!</a>';
                            if('le Vesuvio'==$term->name) echo '<a href="/akh/le-vesuvio/">Go!</a>';
                            if('Lwzaar Seafood Market'==$term->name) echo '<a href="/akh/lwzaar/">Go!</a>';
                            if('Shawarma Albisana'==$term->name) echo '<a href="/akh/lwzaar/">Go!</a>';
                            if('Chaclate'==$term->name) echo '<a href="/akh/chaclate/">Go!</a>';
                            if('news'==$term->name) echo '<a href="/akh/news-events/">Go!</a>';
                            if('events'==$term->name) echo '<a href="/akh/news-events/">Go!</a>';
                            </div>
                                </div>
                                <?php endwhile; else: ?>
                                <?php endif; ?>

news,events not showing custom "GO"link

http://codepad.org/MtKNfPni

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.