I have understand that you want return 2 different things with the same function. If what I understood is correct then:
With your javascript ajax function you can pass a var which save the page that need the correct loop and you can check the content of this var in your misha_filter_function() to echo one loop or another.
You can now add different styles for each loop.
I recommend you that you save the html tags of your output in a var. ( $output.=… ) and finally you should use echo $output.
If this is not the answer that you are looking for, you can clarify it in a comment.
Related Posts:
- Modify category archive page loop on functions.php
- AJAX: WordPress filters inside $html do not work as intended
- How to make a image-size selected by default in Media upload – WP v3.5
- What is This esc_html_e() i wordpress php?
- How can I fetch loop of post titles via AJAX?
- Apply class to every paragraph that holds image?
- Remove “Insert from URL” link in Media upload – WP 3.5
- static variable loop not working in WordPress
- adding a filter to a shortcode?
- username_exists() function can’t be access without logging in
- Set media upload attachment link to none and hide it in WP v3.5
- Build a content and excerpt grid loop with paging and options for # of posts
- Change the footer text on the login page
- add_filter to post-gallery and remove all ‘s?
- Can i check if user is doing any ajax request?
- Displaying post per day
- How to overwrite youtube embed?
- Rewriting search and pagination base
- Check if page parent has certain template
- Change comments form title on a page by page basis
- Display only text to WordPress loop without loosing the text formatting
- Remove class that has been added by parent theme
- How to add active class to custom menu using while loop and wp_list_pages
- delete an array element when its date expires
- How can I loop into two different DIVS without repeating the DIVs
- How to add default images into theme customizer image control?
- How do I know what variables are passed in a filter/action and what their meaning is?
- Why do filters/actions require an argument count?
- Is the regular ajax request method safe or I should use admin-ajax.php?
- Validate a users email address when using gmail to register
- Click loads template via ajax
- How to set a custom path, for ajax image upload folder in admin?
- How to speed up admin-ajax.php in wordpress
- How to use return in my custom function instead of echo
- Simple AJAX notification when the new post is added to the database
- Warning: in_array() null given in PHP function
- Upload multiple files in randomly generated folder using wp_upload_bits
- Create page template via functions.php?
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Add meta tags to a custom header
- Ajax filter button display all posts
- How to have different site identity logos on each page on Astra Theme [closed]
- use loop to return blog details
- How to get current post category details inside “loop”?
- Why i can’t get custom fields value or post ID via Ajax?
- Post not populating for custom post type based on category selection
- Custom query vars filters problem with pagination
- Get the name of menu item with wp_nav_menu
- Can an AJAX callback function access a PHP variable which was defined during initial page load?
- cURL needing to loop through all “next_page”
- How to bind each “the_content” elements to a custom variables
- Filtering custom posts by using checkboxes for taxonomy in an ajax loop always gives server 500 error
- Reload page with a different shortcode when a user selects from a dropdown
- Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)
- Offset with ajax load more posts duplicates
- ajaxurl usage for a custom function
- How can I get my pagination loop to display the correct number of total pages?
- How to call a function from functions.php with ajax?
- Custom Bulk Actions handler not firing
- Custom Post type Ajax search results
- How to generate customized filtered output for the gallery
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- How to remove title tag with this filter
- How fix error in the WordPress loop?
- Find the method which AJAX GET calls
- str_replace not preserving whitespace
- My query keeps looping infinitely ! how to stop it?
- Retrieving specific images from Media Library
- AJAX Returning Way Too Many Posts
- Apply filters when loading post via ajax
- wordpress ajax return 0
- wp_delete_comment is doing nothing
- Registration form not registering First and Last name
- Woocommerce Price Text
- Limit Taxonomy Parents
- Display a post based on its metabox selection
- Modify php code to pass a page id as a parameter in order to create a breadcrumb
- Pagenav Not appearing on custom Template
- Search box background on a different page template
- Display a list of users with avatar filterable with alphabets
- Way of getting queried loop before the query with a filter hook?
- ajax form function error
- Why not showing all post by default in my jquery filter
- For each loop will not append to the_content hook
- Options.php loop won’t show!
- Loop on a wordpress Page instead of content coming from the WP text editor
- Assign new post author IF another user in custom field on post transition
- Add attribute to featured image with filter (wp_get_attachment_image_attributes)
- How to add different menu items on different menus?
- How to pass value to add_filter wpcf7_form_tag from another function?
- Add text below WooCommerce short description if metabox value is true
- Is there a hook that I can use when a fatal error occurs?
- Unable to logout correctly after wp-login file was modified
- I got this error POST https://localhost/meraboilerwp/[object%20Object] 404 (Not Found)
- How can I display a Divi content inside a modal based on an AJAX request
- Adding Author Filter to CPTs
- How can I display formatted content using the_content filter?
- Ajax Filters with Multiple tax_query args
- How do I ensure that the URL parameters are updated correctly when multiple filters are applied
- Filtered queries not responeding to page path