【发布时间】:2017-10-22 18:17:57
【问题描述】:
我正在使用 wordpress 插件来显示房地产数据。当在 db 中找到某个值时,我需要在 wordpress 页脚中显示某个 sn-p 代码。细节。我已经使用以下函数显示了页脚代码:
// Adds Tucson Association of Realtors required board html to wp_footer()
dynamically.
function wwidx_footer_script() { ?>
<div class="aztarfooter" style="text-align:center;">©2016 Tucson Association of Realtors. All rights reserved. All information deemed reliable, but Not Guaranteed. IDX information is provided exclusively for consumers' personal, non-commercial use and may not be used for any purpose other than to identify prospective properties consumers may be interested in purchasing.<br> <br><img src="https://www.weeboweb.com/wp-content/uploads/2016/10/tarlogo.gif"><br><img src="https://www.weeboweb.com/wp-content/uploads/2017/05/EHO-logo-e1494994377845.jpeg"> <img src="https://www.weeboweb.com/wp-content/uploads/2017/05/MLS_Clear-1-e1494994488609.jpg"></div>
<?php }
add_action( 'wp_footer', 'wwidx_footer_script' );
这个函数在我想要的位置和几乎想要的方式显示代码。问题是我需要让它动态化。在我的数据库中,有一个名为wp_realty_controlpanel 的表。在该表中,有一个名为controlpanel_masterdb_user 的字段。当该表中的值为"wwidx_az_tar" 时,我希望显示代码,否则不显示。您可以在这里Link 看到我想要的确切位置的 sn-p。
感谢任何帮助。
【问题讨论】:
标签: php mysql database wordpress