• My site is set up so that the right side bar uses a hook in the functions.php file to pull 1 of 2 forms. Certain pages that are listed ie ‘workbench-basic’ use one type of form (quoteform.php), and the pages that are not in the list default to using the (shortform.php) file.

    So by default, each page i create always has one of the 2 forms attached to it.

    How can I have create a page that does not pull any of the forms at all with these setting? Is there anything that I can add to this hook to fix this or any other way while not changing the current settings for other pages.

    I have posted the code below and the website link is: mobilemarketing101.org/steelsentry

    Hook Code in function.php file:

    // Shortform or Mini-QF
    add_action('before_sidebar_rt', 'ss_whichform');
    function ss_whichform() {
      if (is_page(array(
        'workbench-basic',
        'workbench-basic-1',
        'workbench-master',
        'workbench-master-1',
        'workbench-double',
        'workbench-corner',
        'workbench-u-shaped',
        'esd-workbench',
        'testesdpage',
        'testformnew',
        'styleform-four',
        'lan-station-mini',
        'lan-station',
        'lan-station-corner',
        'lan-server-cart',
        'rover-cart',
        'base-cart',
        'rx-table',
        'modular-cart',
        'microscope-table',
        'wall-unit',
        'lab-island',
        'packing-station',
        'shipping-station',
        'print-shop-station',
        'custom-new-facility'
        ))) {
        include(TEMPLATEPATH . '/mini_quoteform.php');
      } else {
        include(TEMPLATEPATH . '/shortform.php');
      }
    }

    [Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter bpierce1165

    (@bpierce1165)

    Please help thank you!

    Thread Starter bpierce1165

    (@bpierce1165)

    also this is more code that I believe is linked to this function

    ` if(!is_page(array(‘workbench-master’, ‘esd-workbench’, ‘lan-station’, ‘lan-server-cart’, ‘rx-table’))) {
    wp_enqueue_script( ‘short-cb’, get_template_directory_uri() . ‘/js/short-cb.js’, array(‘jquery’, ‘ss-theme-js’), false, true );
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Trouble with Hook’ is closed to new replies.