wordpress print custom fields or include custom fields to print
飞龙更新于 2010-07-01 11:44 加入书签 CTRL+D 有 22 个朋友来过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.
维护小站,感谢赞赏。
联系飞龙,请转淘宝。
飞龙初发:
2010-07-01 11:44
本文更新网址:
https://feilong.org/wordpress-print-custom-fields
所在目录: wordpress