wordpress print custom fields or include custom fields to print

If you want to print special custom fields of a post or page when using wordpress 2.9.2 or wordpress3.0, feilong suggests you this solution in this post,The modified url is http://feilong.org/wordpress-print-custom-fields Go ahead.

Firstly,how to print wordpress contents or comments

1.download the latest wp-print plugin by lesterchan
http://lesterchan.net/wordpress/readme/wp-relativedate.html

2.install and activate the wp-print plugin in your wordpress blog admin

3.inset in the loop of your wordpress theme the template tags below:
<?php if(function_exists(‘wp_print’)) { print_link(); } ?>

Secondly,how to print wordpress custom filelds

4.open wp-content/plugins/wp-print/print-posts.php with editplus or notepad.

5.search print_content(); and paste codes behind it in the <?php ?> tag.
_e(‘<h3>Feiloong Prints Custom Field weather</h3>’);
//thanks to forums.lesterchan.net/index.php/topic,1377.20.html
global $post;
$key=”weather”;$postid = get_the_id();
$printweather = get_post_meta($postid, $key, true);
echo $printweather;

Enjoy!

Thanks to share it to others or track the newest content.

发表评论

电子邮件地址不会被公开。 必填项已用*标注