• Gabriel

    (@moosedesignmalta)


    Hi,

    I’d like to use Custom Content by Country within a custom template to call a custom query within my php template. Please have a look at my code below. I think it just might be something to do with how I split the shortcode.

    
             <?php echo do_shortcode( '[CBC country="us" show="y"]' ); ?>
    
                <?php 
                    $args = array(  'post_type'=> array ('course'),
                                    'meta_key' => 'wpcf-certificate',
                                    'meta_value' => 'faa',
                                    'tax_query' => array(
                                        array(
                                            'taxonomy' => 'course-status',
                                            'field'    => 'slug',
                                            'terms'    => 'upcoming',
                                        ),
                                    ),
                    );
                    query_posts($args); 
                    if (have_posts()) : 
                ?>
    
                   <?php the_permalink(); ?>
    
                <?php else : ?>
    
                    Do nothing
    
                <?php endif; ?>	
                
             <?php echo do_shortcode( '[/CBC]' ); ?>
    
  • The topic ‘How to use the shortcode to call a custom query in php template’ is closed to new replies.