飞龙博客

feilong.org

wordpress print custom fields or include custom fields to print

feilong.org 修订于2010-07-01 11:44:03 472 次浏览

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:03 feilong.org 于广州

加入收藏夹,查看更方便。

所在分类: wordpress

新作:

旧文:

AI表情 AI音乐 blog money bui 教程 echarts 教程 eclipse 教程 html css 教程 IT趋势 js 教程 json 教程 mysql 教程 nodejs npm 教程 onblog SQLite 教程 tutorials vscode 教程 wap网站 winpe启动盘 wordpress 主机推荐 人工智能 前端开发 博客 名企名网 域名注册 常用软件 建站程序 操作系统 教程 数码 无线上网 日记 电子商务 电脑笔记本 网站 网站优化 网站开发 网站推广 网站策划 网络 虚拟现实 默认