我正在使用https://wordpress.org/plugins/custom-post-type-ui/ 自定义帖子类型的插件。现在,我需要在我的页脚区域显示联系信息、电子邮件、电话号码、地址等。为此,我使用上述名为contact
, 现在,我应该如何在我的小部件区域中显示此帖子类型,以便在页脚中显示其所有字段。php。
在小工具区域中显示自定义帖子类型
1 个回复
SO网友:Mainak Ray
您不必进行post类型的联系。只需在Wordpress的小部件区域创建一个动态侧栏。然后在动态侧边栏中获取文本小部件,复制html并将其粘贴到您创建的动态小部件区域中。如果您无法使Dynamc侧栏将代码粘贴到您的函数中。php
register_sidebar( array(
\'name\' => __( \'contact_sidebar\', \'twentythirteen\' ),
\'id\' => \'sidebar-4\',
\'description\' => __( \'Appears on posts and pages in the sidebar.\', \'twentythirteen\' ),
\'before_widget\' => \'\',
\'after_widget\' => \'\',
\'before_title\' => \'<h2>\',
\'after_title\' => \'</h2>\',
) );
然后在你的页脚上调用它。php编制人<?php dynamic_sidebar(\'sidebar-4\');?>
结束