Skip to content
Advertisement

get_meta_tags – if else [closed]

I have:

JavaScript

How I can add if else, If the meta tag ‘filter-title’ doesn’t exist and I only want to display the text “Filtering” instead?

Advertisement

Answer

to check for the existence of an array key use array_key_exists( 'keyName', $array ).

Like this:

JavaScript

You can substitute whatever you like in place of ‘no filter title found’.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement