Need help creating a script that runs a function on every post
-
I am very new to wordpress and php but I have a website with a few thousand custom posts. Each post has an address associated with it. On the admin page for each post there is a button that says “Place Pin At Address”. When I click this button it creates a pin and it now shows up on the map on my sites homepage.
The problem is that it is extremely time consuming to click this button for every single post. Is it possible to run a function that will place this pin automatically whenever a post is published? I could be wrong but I believe all of the google functions are in javascript rather than php. Does that matter? I tried doing something like:
add_action( ‘publish_post’, ‘codeAddress()’ );
but it doesn’t work. codeAddress is just one of the functions in the google map javascript functions folders in the theme. Any help would be greatly appreciated!!
- The topic ‘Need help creating a script that runs a function on every post’ is closed to new replies.