OceanWP Header background image black

Did you try to control this with a function?
And did it stop working recently and is now only showing a blacked out area?
Did you use the hook ocean_page_header_background_image and the function as posted in the OceanWP docs?

Well… Just change your script to give back the image ID instead of the URL:

if ( is_singular( 'post' ) ) {
  // $bg_img = get_stylesheet_directory_uri() . '/img/my-image.jpg';
  $bg_img = 1394;
}

You’re welcome.
Have a nice day!

PS.
Also posted to support hoping maybe OceanWP can fix this, so we can use the image filename/URL again?

WordPress Auto Logout

When you click on the “Remember Me” option on the login page of your WordPress website, it will keep you logged in for 2 weeks. If you don’t, it will keep your login active for 2 days. However, you can extend the auto logout period in WordPress by adding a little code snippet. Keep in mind that it will affect site’s security by keeping user logged in for too long.

function keep_me_logged_in_for_1_year($expirein) {
return 31536000; // one year in seconds
}
add_filter( 'auth_cookie_expiration', 'keep_me_logged_in_for_1_year' );

The above code will keep your authentication cookie for a year.

Have a nice day!

WordPress 404 errors

How To Fix Broken Permalinks In WordPress.
WordPress is a powerful CMS. Sometimes a slight tweak can make your website inaccessible. Another common problem that most WordPress users face at some point is WordPress posts returning a 404 Error. In this article we will show you how to fix WordPress posts returning 404 error.

Usually in this scenario a user can access their WordPress admin area, their blog’s main page, but when accessing a single posts they get a 404 Not found error. First of all, don’t panic most of the time your posts are still there and completely safe. This usually happens if your .htaccess file got deleted or something went wrong with the rewrite rules. What you need to do is fix your permalinks settings. There are several sites describing this, below is the summary of what you actually need to do.

UPDATE JULY 2021: “Still haven’t found what I’m looking for”… so I wrote my own htaccess_keeper plugin. It runs on the normal homepage of the website to save the htaccess to a backup file (when changed), and restores it when a zero bytes file has been detected. It also shoots of an e-mail to the admin that it had to jump to the rescue again!
Interested in this plugin? It is for sale, just contact My Brain.

Continue reading WordPress 404 errors