• Resolved khunmax

    (@khunmax)


    Hey Ken

    I am using live chat to engage my visitors and promote sales.

    I can select what pages to display the chat box on using WP is_page function which accepts an array string.

    For example:

    add_action( 'wp_footer', 'chat_add_script' );
    function chat_add_script() { ?>
    <?php if ( is_page( [233,24,1068,1082,] ) ) : ?>
    <script type='text/javascript' data-cfasync='false'>
    ...CHAT SCRIPT IS LOCATED HERE...
    </script>
    <?php endif; ?>

    My problem is that I also want to chat with customers from my LP Courses page so that I can convert more sales of my courses. If I view the LP courses page in the wp admin editor I can see a page number in the url at the top of the screen. However that number does not work if I insert it into the above array string of page ids ([233,24,1068,1082,]).

    How can I configure the code above to ensure the chat box is displayed on the courses page?

    Thanks for your kind assistance.

    Regards

    Max

    • This topic was modified 6 years, 5 months ago by khunmax.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Ken Nguyen

    (@kendy73)

    Hi Max,

    Please try this condition:

    is_post_type_archive('lp_course')

    and let me know 😉

    Regards,

    Ken

    Thread Starter khunmax

    (@khunmax)

    Ken

    Thanks for your prompt reply.

    At present if have this:

    <?php if ( is_page( [233,24,1068,1082] ) ) : ?>

    How can I include your code:

    is_post_type_archive('lp_course')

    into the above string?

    Thanks for your assistance.

    (please note that in my first post my string code had an extra comma after 1082. That error has now been fixed).

    Kind Regards

    Max

    • This reply was modified 6 years, 5 months ago by khunmax.
    • This reply was modified 6 years, 5 months ago by khunmax.
    Plugin Contributor Ken Nguyen

    (@kendy73)

    <?php if ( is_page( [233,24,1068,1082] ) || is_post_type_archive( 'lp_course' ) ) : ?>

    Sorry Max :), please try this.

    Regards,

    Ken

    • This reply was modified 6 years, 5 months ago by Ken Nguyen.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Identifying Courses page in WP is_page array string’ is closed to new replies.