• Creator
    Topic
  • #995
    Anonymous
    Inactive

    Hello,

    I need to show the contact form only for some pages.. for example I need to hide it for the home page.

    How?

    Thanks Simone

Viewing 10 replies - 1 through 10 (of 10 total)
  • Author
    Replies
  • #996
    Anonymous
    Inactive

    Sorry,

    I need contact form only for POSTS ( no for pages)

    Thanks
    Simone

    #997
    MillaN
    Keymaster

    You have tutorial for this here:

    http://www.millan.rs/tutorials/simple-contact-slider/enable-slider-only-on-some-pages/

    You can write any condition you need.

    Milan

    #998
    Anonymous
    Inactive

    I added this code :

    <?php

    function millanrs_contact_slider_display($show) {
    if (is_singular(‘page’)) {
    $show = false;
    }

    return $show;
    }

    add_filter(‘scs_contact_slider_display’, ‘millanrs_contact_slider_display’);

    ?>

    the result is SERVER ERROR

    I look forward to your reply.
    Regards,
    Simone

    #999
    MillaN
    Keymaster

    Where have you added this code? Code is correct, but the problem can be with opening and closing of if you add it into already opened php code section.

    Milan

    #1000
    Anonymous
    Inactive

    ok fine.. now is working.

    can you explain me how to recognize the ID number to enable a unique page?

    example:

    if (is_page(166)) {
    $show = true;
    }

    thanks
    Simone

    #1001
    MillaN
    Keymaster

    Tutorial has two examples: disable all pages in settings, and enable for some pages with filter and to enable for all in settings and disable some with filter. So, the trick is the settings for visibility and use of filter (is it or is it not a specific page).

    Milan

    #1002
    Anonymous
    Inactive

    here

    if (is_page(166)) {
    $show = true;
    }

    166 is not the ID of the page?

    #1003
    MillaN
    Keymaster

    Yes, if the page ID is 166, that will recognize that specific page.

    #1004
    Anonymous
    Inactive

    Ok so my question is how to recognize or where to see the page ID.

    Thanks
    Simone

    #1008
    MillaN
    Keymaster

    WordPress pages admin panel has Id in every link there. There are plugins that add column with id.

    Milan

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘contact form shown only for some pages’ is closed to new replies.