WordPress.org

Ready to get started?Download WordPress

Forums

Which hook should I use to insert code inside "the loop" after "the_post()"? (4 posts)

  1. arkinsokin
    Member
    Posted 3 years ago #

    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!

  2. Mark / t31os
    Moderator
    Posted 3 years ago #

    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

  3. arkinsokin
    Member
    Posted 3 years ago #

    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!

  4. Mark / t31os
    Moderator
    Posted 3 years ago #

    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.. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.