Some Coding Help

abc

Affiliate Guard Dog Member
Joined
May 20, 2015
Messages
231
Reaction score
94
So used to use the code below to turn our site header into our H1 tag worked till a few weeks ago, now H1 tags show up as empty when checking.. Its on WP anyone see an error or have a suggestion,

<h1 id="logo" class="image-logo" itemprop="headline">
<a title="<?php the_title(); ?>" href="<?php echo esc_url(home_url()); ?>"><img src="<?php header_image(); ?>" alt="<?php the_title(); ?>"></a></h1>
 

xecutable

Stranger
Joined
May 2, 2011
Messages
244
Reaction score
231
I see no syntax errors, are you sure you haven't changed the h1 css? Perhaps inspect with chrome's inspect and check what exactly is happening where the h1 line is supposed to be.

Or throw a message and I can do that myself in my free time.
 

abc

Affiliate Guard Dog Member
Joined
May 20, 2015
Messages
231
Reaction score
94
Its across a network of about 45 sites, so thinking its something i might have changed on my server thats preventing php from being read
 

AussieDave

24 years & still going!
Joined
Nov 28, 2013
Messages
4,991
Reaction score
3,532
Its across a network of about 45 sites, so thinking its something i might have changed on my server thats preventing php from being read

If PHP wasn't being read, interpreted, then WP wouldn't load ;)

WP has just had another update...
Best practice is to test your coding, by removing the php in your code, a replacing that with hard coding.

Code:
<h1 id="logo" class="image-logo" itemprop="headline">
<a title="add your title" href="add you site's home URL here"><img src="add your image URL here" alt="add your alt text here"></a></h1>

If that works, then the problem could possibly be with the wordpress updated core. In which case, you'll need to find the new syntax for the php coding, and adjust the code as required.
 

xecutable

Stranger
Joined
May 2, 2011
Messages
244
Reaction score
231
The newest WP update stopped support of the jQuery-migrate which gave plugins and themes using older codes to function properly. I did have issues but on the backend, that seemed from Yoast, but it was the jQuery. As soon as I managed to fix it, blank lines, missing writing spaces, and crashing plugins, started working.

The point of running Inspect from Chrome is to see what errors the console reports to be able to pinpoint the origin of the problem. So while it can be the php itself, it might be something that runs before it crashing and making everything else go sideways.
 

baldidiot

Affiliate Guard Dog Member
Joined
Feb 23, 2011
Messages
708
Reaction score
215
Maybe post one of the sites as an example so people can see what's being output. Or paste the html output for that section of one of the sites if you don't want to post the url, that would at least narrow down where the problem could be.

Did you update anything recently other than wordpress, eg: theme, plug in etc?

Is the header image set correctly?
 
Top