gehwissenlos / schemaorg-custom-field

Adds a custom field named schema to the head-area of Wordpress
GNU General Public License v3.0
1 stars 0 forks source link

Not working on Pages #2

Open mj00712 opened 4 years ago

mj00712 commented 4 years ago

I have used the schema code in a page custom field but it is not working there.

Originally posted by @mj00712 in https://github.com/gehwissenlos/schemaorg-custom-field/issues/1#issuecomment-547030723

gehwissenlos commented 4 years ago

Hello, You could remove "&& !is_page()".I think it should work then.

mj00712 commented 4 years ago

<?php $schema = get_post_meta(get_the_ID(), 'schema', true); if(!empty($schema) is_single() && is_singular()) { echo $schema; } ?> Is this correct?

gehwissenlos commented 4 years ago

if(!empty($schema) && is_single() && is_singular()) {

mj00712 commented 4 years ago

Tried but didn't work