douchengchen7959 2011-12-07 15:29
浏览 40

Wordpress - 自定义元标记由自定义插件控制

I have recently built a plugin for Wordpress sort of Special Events & News listing. I have a listing page and then a detailed page for every news item. Now in the database I have set up 3 columns named meta_title, meta_description and meta_keywords. I also have All in one SEO plugin installed.

Is there a way how from within the plugin (from the loop where I am showing the content), I can say for example wp_page_meta = $meta_title or something similar?

As I found some tricks on how to do this by hacking the functions.php and header.php for the theme but this is not the right way.

  • 写回答

1条回答 默认 最新

  • doukang7486 2011-12-08 00:44
    关注

    You may want to check out the get_post_meta function in the codex and create custom meta boxes for each event, instead of dealing with the database directly. http://codex.wordpress.org/Function_Reference/get_post_meta

    To add a meta box: http://codex.wordpress.org/Function_Reference/add_meta_box

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大