Steven Ferrino

Technical SEO / PHP Developer

  • Home
  • SEO
  • Local Search
  • PHP
You are here: Home / Wordpress / [Fix] – Jupiter Theme: /jupiter/dynamic-styles/global/header.php on line 346

[Fix] – Jupiter Theme: /jupiter/dynamic-styles/global/header.php on line 346

December 20, 2017 by Steven 1 Comment

After updating the WordPress Theme on a customers website, I was shown a white screen with the line:

Can’t use function return value in write context in /wp-content/themes/jupiter/dynamic–styles/global/header.php on line 346

Luckily I had just made a copy of the theme before updating it. Later on, during a time when no one would be visting the site I went back to look at it and fix the issue.

The original code line was:

$logo_width = !empty( get_post_meta( $post_id, ‘logo_width’, true ) ) ? get_post_meta( $post_id, ‘logo_width’, true ) : ”;

 

Change it to:

$test_logo_width = get_post_meta( $post_id, ‘logo_width’, true );
$logo_width = !empty( $test_logo_width ) ? $test_logo_width : ”;

This type of code will happen 3 more times in that file, and you have to change them all to be of similar structure.

#2:

$light_logo_width = ! empty( get_post_meta( $post_id, ‘light_logo_width’, true ) ) ? get_post_meta( $post_id, ‘light_logo_width’, true ) : ”;

 

Change to:

$test_light_logo_width = get_post_meta( $post_id, ‘light_logo_width’, true );
$light_logo_width = ! empty( $test_light_logo_width ) ? $test_light_logo_width : ”;

#3:

$sticky_logo_width = ! empty( get_post_meta( $post_id, ‘sticky_header_logo_width’, true ) ) ? get_post_meta( $post_id, ‘sticky_header_logo_width’, true ) : ”;

 

Change to:

$test_sticky_logo_width = get_post_meta( $post_id, ‘sticky_header_logo_width’, true );
$sticky_logo_width = ! empty( $test_sticky_logo_width ) ? $test_sticky_logo_width : ”;

#4:

$mobile_logo_width = ! empty( get_post_meta( $post_id, ‘responsive_logo_width’, true ) ) ? get_post_meta( $post_id, ‘responsive_logo_width’, true ) : ”;

 

Change to:

$test_mobile_logo_width = get_post_meta( $post_id, ‘responsive_logo_width’, true );
$mobile_logo_width = ! empty( $test_mobile_logo_width ) ? $test_mobile_logo_width : ”;

Filed Under: Wordpress

Steven Ferrino

Recent Posts

  • Google Core March 2023 Not Just E-A-T
  • [Fix] – Jupiter Theme: /jupiter/dynamic-styles/global/header.php on line 346
  • Laravel 5.4: SQLSTATE[42000]: Password_resets – [Solution]
  • Restrict wp-login.php Access With Htaccess
  • Reading CSV Data and Ignoring NA’s

Blogroll

  • Microdata Generator

Profiles

  • LinkedIn
  • Twitter

Copyright © 2023 · Dynamik-Gen on Genesis Framework · WordPress · Log in