Which hook should I use to insert code that would run at each post within "The Loop" of a theme? I don't want "the_content" because that only affects the output. I need to run some PHP. Thanks!
Which hook should I use to insert code that would run at each post within "The Loop" of a theme? I don't want "the_content" because that only affects the output. I need to run some PHP. Thanks!
The following actions are available inside a regular loop.
the_post
Is called each time the_post() runs.
loop_start
Runs before the loop.
loop_end
Runs after the loop.
See here for more.
http://codex.wordpress.org/Plugin_API/Action_Reference
thanks, "the_loop" worked great for me. That was exactly what I was looking for. But did you know there is no reference of this hook at all in the link you gave me? I looked through it and never found it. Thanks so much again anyways!
It's listed on the page above (8th up from the bottom), it's just not got it's own page.. :)
Happy i could help.. :)
This topic has been closed to new replies.