0

Hi

I have the following code:

$locationcheck = wp_strip_all_tags( 
            get_the_term_list( get_the_ID(), 'project_location', ' ', ' , ', ' ') 
            );

And I want to check if the value of $locationcheck is equal to ">> Online/Remote <<"

However, I am getting stuck with the >> and << as it doesn't seems to be recognising it.

The code I am using, which works fine if I check for a different value without >> and <<, is as follows:

if($ProjectTheme_enable_project_location == "yes" AND $locationcheck <> ">> Online/Remote <<"):

Can someone advise - do I need to amend the >> and << to something else in the above code (I can't change the actual value) or apend something to them?

Many thanks
Mark

3
Contributors
4
Replies
15
Views
2 Years
Discussion Span
Last Post by magicmarkuk
0

Thank you.

I have amended the relevant part of the code to:

AND $locationcheck == "&#187; Online/Remote &#171;"):

but no joy.

I have also tried

AND $locationcheck <> "&#62;&#62; Online/Remote &#60;&#60;"):

but it doesn't seem to recognise it?

I have even tried changing the spaces as well i.e.

AND $locationcheck == "&#62;&#62;&#32;Online/Remote&#32;&#60;&#60;")

but again no joy.

Am I missing something?

Many thanks
Mark

Edited by magicmarkuk

0

On the page you're searching, have a look at HTML view source in the browser, locate the piece of text and see what's written there. Then you'll know if it's

&lt; &gt; or whatever else

0

Thank you!

It was actually

&gt;&gt; Online/Remote &lt;&lt;

I didn't realise there was such a difference!

Thank you both once again for your help.

Regards
Mark

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.