WordPress.org

Ready to get started?Download WordPress

Forums

how to make a conditional statement in wordpress “ function.php” using if is_qa_ (5 posts)

  1. heradius
    Member
    Posted 2 years ago #

    I want to put a condition statement in wordpress function.php which will call certain function in all pages except in qa_pages.

    Below are the functions which i want to be called, except if it is a question and answer page.(qa_page())

    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');

    please help if anybody has an idea, I'm illiterate in php.

  2. jacobuid
    Member
    Posted 2 years ago #

    if (!qa_page()) {
    	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');
    }

    This may work not sure...

  3. heradius
    Member
    Posted 2 years ago #

    this doesn't work
    i want those functions not to be called in qa pages (is_qa_page())

  4. jacobuid
    Member
    Posted 2 years ago #

    i am unfamiliar with the function is_qa_page() and cant seem to find it online anywhere, do you have a link to documentation on this function?

  5. heradius
    Member
    Posted 2 years ago #

    is_qa_page is defined by Q&A plugin by wpmudev. I have used is_ga_page because it will require to use an If statement like "<?php if (is_qa_page()){............"

Topic Closed

This topic has been closed to new replies.

About this Topic