• What function do i have to use in wordpress to trigger my function is it ajax call??im making a plugin and im calling my function manually nad finding the content but i think it can automatically be called but how??. for example i have a page Home and Product when i click the home page it will call my function and display it in the content area and also the same when i click Product it will call my function Product and display something in the content area? Please help me with this im stuck here dont know what wordpress function to use.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You first need to ensure that you are enqueuing your javascript correctly. See wp_enqueue_script().

    Thread Starter sukarno21

    (@sukarno21)

    im using wp_enqueue_script().My problem is how can i call my function and load into the content area automatically cause im doing it manually? for example i have a link home and product when i click product in one of my navigation it will call that function and that call will call the php file and it will show in the content area. how can i achieve this? im new in wordpress. thank you.

    wp_enqueue_script() will load your js automatically. After that, it’s really down to the .js script as to what gets called when and how.

    Thread Starter sukarno21

    (@sukarno21)

    how can js call my function in php? and what function in php should i call when i want to put in the content area? thank you for the reply @esmi. . . .

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘What function in wordpress can trigger a function’ is closed to new replies.