请在函数底部添加以下代码。php,我已替换为您的菜单项ID
function lidget_popup_link() {
?>
<script type="text/javascript">
jQuery(window).load(function() {
var width = "680", /* Enter popup window width here */
height = "480", /* Enter popup window height here */
menuItem = "menu-item-140", /* Enter menu item ID */
target = "#"+menuItem+" a",
hrefVal = jQuery(target).attr("href")
;
jQuery(target).attr({
"href" : "#",
"onclick" : "window.open(\'"+hrefVal+"\',\'\',\'width="+width+",height="+height+",scrollbars=no,resizable=no,location=no,menubar=no,toolbar=no\')"
});
});
</script>
<?php
}
add_action(\'wp_head\', \'lidget_popup_link\');
function lidget_call_jquery() {
wp_enqueue_script(\'jquery\');
}
add_action(\'wp_enqueue_scripts\', \'lidget_call_jquery\');
?>
详情请参见
wordpress.org support输出(在弹出窗口中打开联系人页面):