• I am trying to set up a theme function to display schema markup on all but one page. I copied the theme function to my functions.php and added the schema code needed which works fine. But I don’t want this code to come through on one particular page. I have seen some topics where people explain that the is_page() doesn’t work in the functions.php without some special code. I can’t figure out how to make this work for my purposes. Specific detailed help would be great. I really only know enough PHP to be dangerous. Here is the code:

    [Large code excerpt removed by moderator per forum rules. Please use Pastebin or a Gist for all large code excerpts, they work better anyway.]

    • This topic was modified 7 years, 11 months ago by Jose Castaneda. Reason: removed large code snippet
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi there!

    What is the parent theme you are using and where did you get it from?

    Thread Starter soberbobo

    (@soberbobo)

    It is BeTheme. The function came from theme-shortcodes.php . I know the theme function works fine in the functions.php . I just don’t know how to make it conditional so it doesn’t display on one particular page. The page id, I don’t want it on, is 146.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using is_page() in child functions.php file’ is closed to new replies.