How to determine when the_loop is running?
-
Hello fellow WordPress hackers. We’ve run into an interesting issue that I hope someone with deep WordPress insight can help us tackle.
We’re writing an action that plugs into the_title and the_content that we’d like to run only for the page title and content or blog post title and content but not when it is in the sidebar or in a recent posts area in a footer, etc.
Running debug_backtrace allowed us to determine when get_sidebar or similar was loading but, obviously, that PHP function is disabled on many many hosts.
Has anyone ran into a similar corner and have any suggestions as to how we can run our action only when the_title and the_content are being run in the main content areas?
- The topic ‘How to determine when the_loop is running?’ is closed to new replies.