Those is_page_template
call will all be false. The AJAX request is an independent request to the server from the client browser. As far as that AJAX request is concernend the page you are on is admin-ajax.php
. You will need to pass a parameter with the AJAX request that you can use to determine which shortcode to run. For example:
data : ( {
action : 'get_left_menu()',
runsc : 'Business menu'
}),
Also, your AJAX action is get_left_menu()
. It should be get_left_menu
to match the wp_ajax_*
actions.
Related Posts:
- Execute a function using ajax
- What’s the point of using WordPress’s built in admin-ajax.php?
- jQuery Plugin to use WordPress functions in AJAX request
- ajax front-end increment views on click
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- Shortcode button dosent work for all posts. Work for first post only
- AJAX button run function
- Ajax : Call undefined function plugin_function() … can’t call any plugin function
- Redirect to another page using contact form 7? [closed]
- How to get specific string/value from an array? php [closed]
- Where Should i write the code for wordpress ajax voting?
- grab or load text on demand
- Cannot pass value variable to WP AJAX functions
- Update User Meta Via Ajax
- Compare Ajax Data Results
- My ajax request don´t work and return 0
- WordPress environment not loading properly
- AJAX login without a plugin does not work. when add a action to function.php
- Plugin update error message
- How to handel multiple checkbox field in the admin settings page with Settings API
- Loading shortcode with ajax
- wp_insert_user – how to send verification email before logging in
- Is the WordPress HTTPS Plugin Still Safe To Use? [closed]
- Set a User as Author of all ‘New Posts’ posted
- How do you auto-activate plugins from child themes
- Ajax call doesn’t work in frontend but it’s working in backend (when I’m logged in)
- What is the function to get plugin base url in multisite?
- Code in theme functions.php faster than with a plugin?
- Admin-ajax.php is dying “0” without processing function
- How to remove an Ajax action
- Override the core function locate_template
- Get Plugin Information from Multiple Sites Externally
- Trying to count the total number of paragraphs inside a blog article
- How to get post URL in the_content filter?
- May i Use ShortCode in Template?
- WordPress Ajax Callback
- Set the active Navigation Menu from a plugin
- Inserting HTML tag with ACF into shortcode
- How to Display a Plugin function (content) on frontpage using index.php
- Form isn’t inserting data into database with ajax plugin
- Theme my Login plugin, how to update fields
- How to create an input field, and base the output on spreadsheet data? [closed]
- WordPress + JavaScipt + AJAX + MySQL: insert query for form
- Customize permalink wordpress category id
- Admin style for just one plugin in dashboard
- wordpress file upload with ajax when site is ajaxyfi
- AJAX search as you type? [duplicate]
- How to set Noindex to all wordpress pages in a catergory?
- How to use my menu PHP code as sidebar?
- Using wpdb without loading all plug-ins via wp-load.php
- Load Javascript from Plugin in One Page Only?
- Call plugin with php function
- How to keep variable `$post` to using in another file
- Is it safe to use admin-ajax.php in the frontend?
- Plugin Development – Functions or Hooks?
- Create WordPress posts from JSON array using plugin in admin
- Proper way to handle admin-ajax calls
- How do I create a custom permalink structure for a page template
- How to remove a class function from a plugin by using remove_action()?
- Ajax object not defined – JS file is in plugin folder
- Need to revert to an older version of wordpress
- Hook for altering the content of all wp mails
- How to get rid of Ellipsis on Woocommerce [Essential] Theme [closed]
- Sharing functions between plugins
- 2 wordpress site same database
- How to copy the all WordPress media items to another custom plugin folder?
- Trouble with AJAX using GET
- Adding LOAD MORE on a page
- WordPress default post categories meta box widget
- Fatal error “Call to undefined function is_plugin_active” each time the plugin is activated
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- Make modification of add_to_cart button specific to single page
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- jquery plugin won’t fire when hamburger class element clicked
- How to wrap image tag into div for post only?
- admin-ajax.php returning 0
- User Following System
- cURL do not mimic click
- Admin page and admin menu. Permissions plugin
- how to repeat taxonomy in different places on wordpress
- Not getting result using ajax on wordpress
- Power Menus plugin destroys menu after adding new item
- how to create table during plugin installation in side a class
- Posting code inside the post instead of in the template file using shortcode
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Can’t get custom user meta to show in header
- Including a PHP file via a function that is part of a plugin?
- overwrite a plugin function in functions.php
- Pass strings to plugin function [closed]
- How to tweak a plugin without preventing it from updating
- WP Members additional fields on user profile [closed]
- Integrate Razorpay quick payments plugin with contact form7 plugin
- Display Video as Post Thumbnail
- Notifications Bar on home page only
- How to make horizontal scrolling menu [closed]
- Make plugin admin page visible to other roles
- How does one add numbers to an admin menu?
- wp_enqueue_script doesn’t load JS in plugin
- Adding fontAwesome to Primary Menu returns after saving the menu
- Prevent primary navigational menu from expanding during page load (WordPress / Astra Theme)