sergio_soares
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
on template i made like this:
<?php // post global $post; $relacionadopost = new WP_Query( array( 'post_type' => 'post', 'connected' => $post->ID ) ); if($relacionadopost) { echo '<h3>Informação Relacionada</h3>'; } while ($relacionadopost->have_posts()) : $relacionadopost->the_post(); ?> <?php $local_evento = get_post_meta($post->ID, 'local_evento', true); ?> <?php echo $local_evento; ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><?php echo $casa; ?><br/> <?php endwhile; wp_reset_postdata(); ?>no output is returned on variable $local_evento
what i’m doing wrong?
suppress filters means what? sorry if i a noob :/
and sorry about the two posts. I missed the button lol
<?php function cria_campos() { global $post; $relacionadocasa = get_posts( array( 'post_type' => 'casa-espectaculo', 'connected' => $post->ID, 'suppress_filters' => false ) ); foreach ($relacionadocasa as $relacionado) : setup_postdata($relacionado); $local_evento = 'teste'; update_post_meta($post->ID, 'local_evento', $local_evento); endforeach; } add_action('publish_post', 'cria_campos'); ?>Thanks Scribu =)
Nice plugin, nice work m8 =)
5*
Viewing 3 replies - 1 through 3 (of 3 total)