doulie0178 2014-09-12 18:32
浏览 12

所有localhost站点都包含假png文件

I've completed development of a wordpress theme for a client, but when we launched the site to an online staging server, I noticed 2 issues:

1) I have three menus created in the WP dashboard: About, Main, and Media. I've selected "Main" to be the main navigation menu, but for some reason, it's not using the menu I've selected. It's grabbing the first menu available, according to alphabetical order. In this case, it's using the About menu. If I change the name of "Main" to "AAMain", it's using the correct menu. I'm not sure how this is happening. Here's the code I'm using to register my menu:

register_nav_menus(
        array(
            'mobile-nav' => __( 'The Mobile Menu', 'bonestheme' )   // main nav in header
        )
    );

And here's the code I'm using for the menu setup:

// the mobile menu
function bones_mobile_nav() {
// display the wp3 menu if available
wp_nav_menu(array(
    'container' => false, // remove nav container
    'container_class' => '', // class of container (should you choose to use it)
    'menu' => __( 'The Mobile Menu', 'bonestheme' ), // nav name
    'menu_class' => '', // adding custom nav class
    'theme_location' => '', // where it's located in the theme
    'before' => '', // before the menu
    'after' => '', // after the menu
    'link_before' => '', // before each link
    'link_after' => '', // after each link
    'depth' => 0, // limit the depth of the nav
    'fallback_cb' => 'bones_mobile_nav_fallback' // fallback function
));
} /* end bones main nav */

// this is the fallback for mobile menu
function bones_mobile_nav_fallback() {
wp_page_menu( array(
    'show_home' => true,
    'menu_class' => '', // adding custom nav class
    'include'     => '',
    'exclude'     => '',
    'echo'        => true,
    'link_before' => '', // before each link
    'link_after' => '' // after each link
) );
}

Lastly, this is the code used in my header.php file to pull in the menu:

<?php bones_mobile_nav(); ?>

2) The second issue is with a single page on my site. This page is using the same page template (page-about.php) as a bunch of other pages in the site, that are all loading fine. But when I try to view this page, I'm getting an error that says "No data received". "Unable to load the webpage because the server sent no data." "Error code: ERR_EMPTY_RESPONSE"

I noticed that there was a few files in my theme folder called "social.png" and social0.png". Additionally, at the bottom of my themes functions.php file, there are includes for these png files – which are actually php files, disguised as png files.

I tried removing the png files as well as the includes in the functions.php file, but nothing seems to be working.

I've been at this for 2 days now. I've run every single scan imaginable within my WP site. The most confusing part is that everything was working perfectly until a few days ago, so I'm 99% certain my code is correct. It seems to be a bug somewhere in the site that's causing this to happen, and I can't figure out how or why this would've happened. I'm using the latest version of WP, and all of my plugins are up to date.

This seems to have affected every single site I'm running on my Mamp Pro localhost – not just this site.

Let me know if anyone has come across this, or knows what steps I can take to debug further.

Thanks

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 用易语言http 访问不了网页
    • ¥50 safari浏览器fetch提交数据后数据丢失问题
    • ¥15 matlab不知道怎么改,求解答!!
    • ¥15 永磁直线电机的电流环pi调不出来
    • ¥15 用stata实现聚类的代码
    • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
    • ¥20 docker里部署springboot项目,访问不到扬声器
    • ¥15 netty整合springboot之后自动重连失效
    • ¥15 悬赏!微信开发者工具报错,求帮改
    • ¥20 wireshark抓不到vlan