飞龙博客

feilong.org 前端开发教程

wordpress print custom fields or include custom fields to print

飞龙修订于 20100701 11:44 35 次浏览

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.

网址:https://feilong.org/wordpress-print-custom-fields
初发:20100701 11:44

想学前端?长按二维码加我微信

想学前端?点击飞龙QQ

分类: wordpress

新作:

旧文:

关闭

长按二维码 -> 识别图中二维码

打开微信,发现,扫一扫

支付完成后,点击下一步

感谢大力支持

然后你手机号:

最后点这,稍等即可