1

I have the below functions

require_once(GABFIRE_FUNCTIONS_PATH. '/review-options.php');
require_once(GABFIRE_FUNCTIONS_PATH . '/custom.php');
require_once(GABFIRE_FUNCTIONS_PATH . '/shortcodes.php');
require_once(GABFIRE_FUNCTIONS_PATH . '/post-types.php');

i want them to be called only on specific page or exclude from specific pages.

I'm confused on how to do this in function.php please help!

the functions i showed above, does conflict with Q&A plugin. this takes place in qa pages. once i try to answer a question, the answer doesn't appear.answers appears only if i remove those functions. Thus I'm looking for a way how I can disable calling those function in qa_pages

  • Post types should be loaded globally. This will create havoc somewhere I'm sure of it. – Brian Fegter Jul 27 '12 at 17:24
1

if you know which page id , for example , you can change your page.php

if ( get_the_ID() == '99' ) {
       my_specific_page_99_calls();
}

and then on functions.php

my_specific_page_99_calls(
     require_once(GABFIRE_FUNCTIONS_PATH. '/review-options.php');
     require_once(GABFIRE_FUNCTIONS_PATH . '/custom.php');
     require_once(GABFIRE_FUNCTIONS_PATH . '/shortcodes.php');
     require_once(GABFIRE_FUNCTIONS_PATH . '/post-types.php');
)

i'm sure there's other options, but this will get you there.

to exclude from specific pages

if ( !in_category('cake') {
       my_specific_page_99_calls();
}
  • thanks for your help. The page i want to exclude, is 'aq_page'(by Q&A PLUGIN by wpmudev.). the above functions are called in function.php. I tried your idea but it didn't work. – heradius Jul 27 '12 at 5:12
  • does your aq_page have the same template as the others? – pcarvalho Jul 27 '12 at 15:47
  • IT HAS DIFFERENT PAGE TEMPLATE – heradius Jul 27 '12 at 16:42
  • well then, instead of changing page.php, did you change that page template? also, why the caps? – pcarvalho Jul 27 '12 at 16:50
  • actually i should describe the problem clearly, the functions i showed above, does conflict with Q&A plugin. this takes place in qa pages. once i try to answer a question, the answer doesn't appear.answers appears only if i remove those functions. Thus I'm looking for a way how I can disable calling those function in qa_pages. – heradius Jul 27 '12 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.