Can't Get Custom Field to Display Outside Loop
-
Please help. I’ve been at this for hours trying to figure out how to make this work.
I’m using a Page template to build a custom RSS Feed that includes my URL shortener prefix. I need to include the shortener as a custom field value, but I can’t get the custom field value to display.
Here’s the code I have so far (with the working fields stripped out for brevity). Please tell me how to fix this so that it works.
<?php $query = new WP_Query( 'showposts=-1&cat=-3,-8' ); ?> <?php global $post; ?> <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?> <item> <link><?php echo get_post_meta($post->ID, 'permalink_prefix', true) ?><?php the_permalink_rss() ?> </link> <?php do_action('rss2_item'); ?> </item> <?php endwhile; wp_reset_postdata(); ?> <?php endif; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Can't Get Custom Field to Display Outside Loop’ is closed to new replies.