Wordpress localhost URL执行两次

时间:2017-03-12 18:26:57

标签: php html wordpress url localhost

网站网址保存在哪里?代码bloginfo(' template_url&#39)

每次点击链接,我都会获得双倍的网站网址。本地主机/ postmyproject /本地主机/ postmyproject

我将site_url设置为:do_action('ProjectTheme_top_menu_items'); $menu_name = 'primary-projecttheme-header'; if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) { $menu = wp_get_nav_menu_object( $locations[ $menu_name ] ); $menu_items = wp_get_nav_menu_items($menu->term_id); foreach ( (array) $menu_items as $key => $menu_item ) { $title = $menu_item->title; $url = $menu_item->url; if(!empty($title)) echo '<li><a href="' . $url . '">' . $title . '</a></li>'; } }

在我的wp-config.php文件中,我有以下设置:

{{1}}

我的主页代码如下:

{{1}}

1 个答案:

答案 0 :(得分:1)

您需要在SITE_URL前面使用http://,如

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

https://codex.wordpress.org/Changing_The_Site_URL