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
- 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?
- static variable loop not working in WordPress
- 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
- Check if page parent has certain template
- How can I loop into two different DIVS without repeating the DIVs
- How to add default images into theme customizer image control?
- Why do filters/actions require an argument count?
- Validate a users email address when using gmail to register
- 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
- How to speed up a wordpress function with multiple loops?
- Custom excerpt function re-factoring
- Get first URL from post content
- Handling Body class based on Template
- get post based on category chosen in drop down – The ajax method
- Add a class to the anchor tag on HTML5 gallery
- add_action shortcut?
- Show css depending on activity type in BuddyPress activity-loop [closed]
- How to store data from multiple forms using ajax and php
- How to control WordPress image metadata (using Imagick)?
- How do I add custom bulk actions to multiple custom post types?
- Ajax category filtering products default show all
- Removing “wpautop” (auto tags) only on certain pages?
- get author_name from queried post
- Why ajax doesn’t work on certain wordpress hooks?
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- WordPress Gravatar filter is removing my custom attributes
- how to refresh div on template part?
- Checking array against author id in loop
- How to disable controls in theme customizer?
- Alter required message using comment form api
- Add item to top of menu using a filter in functions.php
- Override a function defined in wp-includes/comment-template.php
- is_user_logged_in() not working in AJAX validation call
- Filtering a function’ output for a new continued function
- Using data sent via AJAX in multiple functions on a WP plugin
- Deleting Certain terms from appearing on the front end as links
- Simple AJAX notification when the new post is added to the database
- Upload multiple files in randomly generated folder using wp_upload_bits
- Create page template via functions.php?
- 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]
- 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
- How to add aria role and schema markup to custom walker container
- Must filter functions receive all arguments passed to them?
- Execute Jquery when a specific page in my plugin is loading
- Strip from or something better?
- AJAX function not working [closed]
- User filter posts by year
- Disclaimer that will show every refresh of the page
- How do I make these combination select filters work when only one dropdown is set? They work in WordPress 5.8.2 but don’t in 5.8.3
- Database entry removed on browser refresh, Ajax PHP jQuery
- Products listing check if meta checkbox is checked
- Apply function.php filter only if url not has /amp/
- Ajax filter with loadmore button
- update_user_meta as multiple value but with same meta key
- register_block_type is not working properly
- Update $wpdb query with AJAX
- 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
- Offset with ajax load more posts duplicates
- 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?
- 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?
- My query keeps looping infinitely ! how to stop it?
- Retrieving specific images from Media Library
- Apply filters when loading post via ajax
- wp_delete_comment is doing nothing
- Registration form not registering First and Last name
- Woocommerce Price Text
- Limit Taxonomy Parents
- Modify php code to pass a page id as a parameter in order to create a breadcrumb
- Pagenav Not appearing on custom 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!
- Assign new post author IF another user in custom field on post transition
- How to pass value to add_filter wpcf7_form_tag from another function?
- Is there a hook that I can use when a fatal error occurs?
- 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
- Filtering with Attributes – how to display all non-queried products below query