A better solution would be to add the filter hooks before the actual call in the template and removing theme when done meaning in your theme before you call your sidebar using dynamic_sidebar
or what ever use this:
add_filter( 'embed_defaults', 'small_embed_defaults' );
dynamic_sidebar('my_sidebar');
remove_filter( 'embed_defaults', 'small_embed_defaults' );
and the same with your main loop:
add_filter( 'embed_defaults', 'big_embed_defaults' );
while(have_posts()){
//YOUR LOOP...
}
remove_filter( 'embed_defaults', 'big_embed_defaults' );
Related Posts:
- AJAX with loop filtering categories
- Exclude filter on front page
- Filtering The Loop For Single Page and Blog Page
- Sort Posts By Category?
- Custom search form to display users only
- How to track post number on the_loop
- How to get an array of years from all of the search results, and use it to filter by year the paginated loop?
- Query posts if meta key starts with
- How to return only one instance of each, from the entire loop
- Query reset problem or flawed code to enable custom post type query
- Filter the loop by categories using checkbox form
- Filter the_posts doesn’t work on search page
- need help looping add_action in wp
- Trying to get property of non-object in shortocde
- Query Nopaging action not having effect
- Make a loop to return x number of posts, but only if they have content or excerpt
- Filter existing hook using parameter and foreach loop
- add_action in the loop hooks
- Loop order issue with Ajax filter
- Add Search and Filter functionality to custom loop
- Reorder posts in a loop: have the posts by one particular author below the others
- How to filter get previous post function by meta value DESC and post date DESC?
- WordPress redundant posts based on meta field
- Remove posts_orderby filter then add it back in
- Buddypress Group Activity Loop Filter activity type [closed]
- Suppress the_content filter in a nested loop
- get_posts and wp_autop (remove filter)
- An action that runs after each post in the loop on index/archive page?
- Help with add_filter(‘the_content’, ‘some_function’) and multiple matches
- Applying a filter to multiple loops for days ago
- Hook in the loop after the first post
- How to fix pagination for custom loops?
- Jquery Slider for profile template
- remove_action or remove_filter with external classes?
- Counting the posts of a custom WordPress loop (WP_Query)?
- Passing a parameter to filter and action functions
- Difference Between Filter and Action Hooks?
- How to know what functions are hooked to an action/filter?
- Get a list of all registered actions
- if ( is_home() && ! is_front_page() )
- Get excerpt using get_the_excerpt outside a loop
- How to display Yoast SEO meta description in archive template for each post instead of the_excerpt()? [closed]
- How can I edit post data before it is saved?
- Get post content from outside the loop
- add_action(), add_filter() before or after function
- Why should I put if(have_posts()), is while(have_posts()) not enough?
- Display featured products through custom loop in woocommerce on template page
- Split Content and Gallery
- How to create an API for my plugin?
- Trouble understanding apply_filters()
- What is the very earliest action hook you can call?
- How to get Author ID outside the loop
- remove custom post type permalink
- Where is the best place to use add_filter
- Remove Actions/Filters added via Anonymous Functions
- wp_headers vs send_headers. When to use each?
- How can i display the content in plaintext
- Redirect loop when trying to login to /wp-admin/ [duplicate]
- How to split a loop into multiple columns
- Is there any action filter/hook for validating a custom field before publishing the post?
- Is it necessary to reset the query after using get_posts()?
- Is there any difference between the_title() and echo get_the_title()?
- How many filter/action hooks are healthy?
- Earliest hook to reliably get $post/$posts
- Do I need to use The Loop on pages?
- Remove the Homepage Query
- remove tags from the_content
- Remove Editor From Homepage
- the_title() shows title of the first post instead of the page title?
- How to force excerpts / teasers in the loop
- What does (10, 2) mean when used with add_filter
- Retrieve each widget separately from a sidebar
- How to only hook on Single.php after content?
- Why am I being limited to ten posts on a custom loop?
- How to list some posts first in the loop based on post id
- Valid characters for actions, hooks and filters
- Should I use loop in the single.php file?
- Advanced Custom Fields and Yoast SEO keyword analysis [closed]
- A search for ‘0’ returns results
- How to check if a hook is hooked or not?
- How to change “Draft” string for status of custom post type to “Unavailable”?
- Implementing advanced add_* function wrappers
- Why do themes rely on “The Loop”?
- Is it possible to use object in add_action?
- How to return loop contents
- Using the Loop to show all levels of subpages under a parent page? Halfway there
- Cleanest Way to Select Every Second Element in a Loop?
- How to set custom cookies before output
- Insert image or ad script after 3 posts using the loop
- Get date of last update outside of loop
- How to correctly get post type in a the_title filter
- Pagination not working on home page
- Child Pages Loop
- How to place comments_template(); outside the loop?
- How to publish a post with empty title and empty content?
- How do you use the plugin boilerplate loader class to hook actions and filters?
- How to restrict actions and filters “properly” by conditions
- Multiple Loops Homepage?
- add_filter OO with parameters
- How to Change Loop to Order Posts by Views (using wp-postviews plugin)