Featured image error on Network front page

Hi guys,

I'm in the process of converting a well-established and high traffic site to Wordpress to convert it into a membership site. I have chosen the Network theme, since that is one of the objectives of the new site (creating a network of sub-sites for regions/sectors) and have re-created a blog post from the existing site.

This post appears on the front page, but when I try to add a featured image to replace the theme default image, I get the following error:

Warning: preg_replace(): Unknown modifier 'a' in /home/acg/public_html/wp-content/themes/network/library/functions/custom-functions.php on line 695

I even tried changing the image size to the Network theme "standard image" size (which would be annoying if I had to create an extra image for each post instead of resizing/cropping an existing image), but to no avail. The only way I can avoid the error while not displaying the picture of cyclists and a message telling me to add an image to the post is to add a default image in Advanced Options and delete the featured image.

That's the way it's currently set up on the test site - http://37.59.246.118/~acg but clearly I need to know why the error is occurring and solve it so I can display the featured image on the front page blog post summary.

Thanks in advance for your help.

Arthur

    Adam Czajczyk

    Hello Arthur,

    I hope you're well today and thank you for your question!

    I tried to replicate the issue on my own setups but no luck. I've got a feeling though that either I'm missing something here or it's a site-specific issue. That said, could you please give me some more tips on the steps needed to reproduce this behavior?

    Also, are there any specific settings of your network that I should take into the account?

    Please advise!

    Best regards,
    Adam

    Arthur

    Hi Adam,

    I don't think there's anything specific to take into account - it's a new, clean install, Multisite+Buddypress and a set of themes and plugins (though the error started before I installed Membership Pro and MarketPress). Might be worth enabling support access so you can see for yourself.

    To go through exactly what I did, it was simply enable and customise the theme a bit (add a header image and logo icon), delete the Hello World post and add a new one, copying and pasting content from an existing article, including images. The post itself looks fine and it is only when adding a featured image that the error occurs. Oh, one more detail - the featured image itself doesn't display, either, so it seems there's something fundamentally wrong with this function, for some reason. The only way to display a different image to the "add an image to post" image is to set a default image in the Advanced Options, as I mentioned before.

    I've enabled support access, but will be experimenting with disabling plugins, etc., meanwhile. I've just tried disabling BuddyPress (the only non-WPMU Dev plugin apart from Hello Dolly!) but that's not made any difference.

    Thanks,
    Arthur

    Adam Czajczyk

    Hello Arthur,

    I'm sorry for the delay on my side!

    I've just installed the theme from scratch on my MultiSite setup, via our WPMU DEV Dashboard plugin ("Network Admin -> Themes -> [enable legacy themes]"), customized it by adding header image, then created a new post (I "copy-pasted" a post from your site, including links and images) and saved. It gave me an error free post with a default featured image.

    Then I've added a featured image from the media library and updated the post but still no errors. I've tried to activate/deactivate various plugins of ours and also BuddyPress, keeping WordPress debugging (which throws error messages to the screen) on for all the testing. I still wasn't able to reproduce this.

    That said, I admit I'm a bit stuck here and seeing this on your site may help here. It seems though that unfortunately the support access has already expired so could you please re-grant it for me? I've subscribed to this thread so please let me know here that the access is enabled and I'll be instantly notified of your post, thus I'll check it asap.

    Best regards,
    Adam

    Adam Czajczyk

    Hello Arthur,

    I'm sorry for the delay on my side.

    I've run some more (unfortunately unsuccessful) tests on my sandbox but the issue still remains a bit of a mystery for me. That said, I've focused on the error message that you're getting and it seems that there's something "not exactly fine" with regular expression in theme's functions. That said, I've asked one of my colleagues (a developer) for help here and hopefully he'll be able to lend us a hand on this.

    Please keep an eye on this thread for further information. It would also be great if you could just keep the support access open until we fix this, just in case the developer would like to take a look personally.

    Thanks,
    Adam

    Adam Czajczyk

    Hello Arthur!

    I was just given some suggestions on this but since I'm not able to replicate the issue on my site I'd need to apply those to yours. However, this is not possible via support access and also I'd need to take a backup of the theme first, just for safety of your site. That's because I'm not able to safely access your site's theme files via WPMU DEV Dashboard and I wouldn't be able to reverse changes in case anything went wrong.

    That said, could you please send in:

    Subject: "Attn: Adam Czajczyk"

    - your site's WordPress admin login URL
    - admin login and password (may be a temporary account)
    - FTP credentials (hostname, username, password, port number if needed)
    - any other relevant URLs and information
    - link back to this thread

    Please use our contact form here https://premium.wpmudev.org/contact/.
    Select "I have a different question" from the drop-down list.

    Please be sure to make a full backup of your entire site first!

    If you wish me to proceed, please send the message as describe above and when you're done with it let me know here.

    Thanks,
    Adam

    Adam Czajczyk

    Hello Arthur!

    I'm sorry for the delay on my side. I was just looking for the message from you in order to investigate the issue but couldn't find any (although I could see there are other messages from you but not directed to me and not assigned to this thread).

    That said, could I ask you please to re-send all the info one more time for me as described in my last post?

    Thank you and I apologize for inconvenience!

    Best regards,
    Adam

    Arthur

    Hi Adam!

    A couple of days ago I had to rebuild EasyApache to add a couple of non-default options for a WPML/BuddyPress issue I'm having with another site, and in doing so it seems to have killed the test site I sent you access to. I'm getting 500 and/or 404 errors for everything.

    I don't know if you can help with this but when I tried hiding everything and creating a new index.html page it went from 500 to 404...but when I removed the tilde and went straight to the (dedicated) IP the page appeared! So something is causing the account to behave weirdly.

    Until I sort this out (which may mean starting again...) we won't be able to look at the problem of the featured image. Basically, it was on the Network theme, where setting a featured image on any blog post caused an error. You couldn't reproduce it, so asked me to have full access to be able, I assume, to replicate the site at your end, for diagnosis.

    If you have any ideas on the server error, they would be much appreciated, otherwise, I'll just start again, I guess, and bring forward my plan to hire server management support!

    Thanks,
    Arthur

    Predrag Dubajic

    Hi Arthur,

    If you activate wp_debug do you see any additional messages besides 500 and 404 errors that could tell us what happened?

    You couldn't reproduce it, so asked me to have full access to be able, I assume, to replicate the site at your end, for diagnosis.

    That is correct, if the problem isn't happening on our installation we usually need to check your installation to see if there are any differences that could causing this or any pointers that could help us replicate it.

    Best regards,
    Predrag

    Arthur

    Hi Predrag,

    I can't do anything on the site at the moment - nothing is accessible, due to the 500 and 404 errors - I've now pointed the domain at the server so you can see http://www.applied-corporate-governance.org is blank and the /wp-login produces the 500.

    I've got a server admin looking at it at the moment so I'll keep you posted. I just added the info to keep you guys updated and see if you had any thoughts.

    Thanks,
    Arthur

    Arthur

    Hi guys,

    Well, after a weird few days of updates and things disappearing and/or corrupting, I've hired a server management company, got everything back up, restored files and...bang, my issue with the featured image is now gone!

    Sometimes you have to have things go really badly to make you take more decisive action and for things to get much better.

    Thanks for trying, I reckon in the end it was a missing php module like suPHP that was causing it, as that solved another issue relating to images on another site.

    Appreciate you guys!

    Arthur