Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
    
Post types should be loaded globally. This will create havoc somewhere I'm sure of it. –  Brian Fegter Jul 27 '12 at 17:24
add comment

1 Answer

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();
}
share|improve this answer
    
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? –  peteroak 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? –  peteroak 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
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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