Help with Custom Fields
-
I am running another script which connects to twitter on my site. I am trying to use a custom field to insert the FRIENDS_USERNAME.
My custom field is called “twittername” I usually use the following code to include custom fields in HTML
$key="twittername"; echo get_post_meta($post->ID, $key, true);
But I don’t know how to include in php. Can someone please take a glance at my code below and see where I might be going wrong?
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php //username and password to pass to twitter - $username = 'xxxxx'; //these dont have to be in caps $password = 'xxxxx'; //$twitterUser = 'YOUR_FRIENDS_USERNAME'; $twitterUser = '$key="twittername"; echo get_post_meta($post->ID, $key, true);'; ?> <?php endwhile; else: ?> <?php endif; ?>
I’d appreciate any help! I am not good with php!
Thanks,
Jon
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Help with Custom Fields’ is closed to new replies.