Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

WordPress AJAX load post metadata in modal

you can use ajax url creating methode of wordpress.

add_action("wp_ajax_clientLogoPopup", "clientLogoPopup");
add_action("wp_ajax_nopriv_clientLogoPopup", "clientLogoPopup");

    function clientLogoPopup()
    {
        $clientID = intval($_REQUEST['client_id']);
        if($clientID > 0){
            echo get_post_meta($clientID , 'client_logo', true);
            // or you can also show other meta fields here.
        }
        die();
    }

write above script in functions.php of your theme

now call the url as per your requirement like this,

http://www.your-website.com/wp-admin/admin-ajax.php?action=clientLogoPopup&client_id=

Related Posts:

  1. update_post_meta Not Processing Array Data (Not Sure What I Am Missing)
  2. Remove item from post_meta array via AJAX
  3. How can I fetch loop of post titles via AJAX?
  4. Retrieve POST data from AJAX call
  5. WordPress Ajax always returns a 404 error
  6. problem with ajax and the path to the php page
  7. How to use wp_localize_script in a WordPress page other than functions.php?
  8. Real time Duplicate title check
  9. Update WordPress Custom Field with AJAX on cached page
  10. Targeting single page with JS
  11. Use ajax to update_post_meta
  12. Click loads template via ajax
  13. How to retrieve the content (with a specific ID) via ajax by clicking a link tag
  14. How to speed up admin-ajax.php in wordpress
  15. Returning a value from a PHP page
  16. Stumped – Ajax Response Returns 0
  17. Sending jsPDF documents to the server
  18. wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
  19. How to test nonce with AJAX – Plugin development
  20. Checking for new message using AJAX and PHP. Server overload?
  21. AJAX request status 200 but no actual “response”
  22. Why ajax doesn’t work on certain wordpress hooks and reload the page instead?
  23. AJAX pagination, update current page
  24. Save Search System
  25. adjust section according to country?
  26. populate form fields in a loop with ajax
  27. dynamic dependent select dropdown
  28. Change “add to cart” button color based on Woocommerce product category [closed]
  29. Ajax request returns ‘Array’. How to output the actual results?
  30. How to add a do_action on refreshing of WP customizer?
  31. Show success or error messages in Ajax response to WordPress custom registration form
  32. How to add a Custom Mailchimp AJAX Newsletter Subscribe Form
  33. Fancybox type popup window that’s not an iframe
  34. How to disable controls in theme customizer?
  35. Can I use a jQuery Ajax request in Code Snippets Plugin for WordPress?
  36. How do I Import / Upload Files with jQuery AJAX?
  37. WordPress Ajax Call inserting data but success response false
  38. Ajax contact form return 0
  39. AJAX – Returning Two JSON Objects with One PHP Function
  40. Unset session variable on page reload / setup but exclude AJAX
  41. Add Ajax Hooks and Call from Custom Template PHP
  42. WordPress Ajax Always returning 0
  43. Function won’t run onclick using Ajax
  44. WordPress plugin admin page – using WordPress function in linked php file
  45. A $_POST should occur when submit form but is not?
  46. My jQuery Ajax form submit is still refreshing page?
  47. jQuery Ajax PHP function call returning [object Object]
  48. Shortcode to pull posts
  49. Unable to Call More than One Meta Box Output
  50. Execute Jquery when a specific page in my plugin is loading
  51. Post meta select input, if statement
  52. what does $options = get_option(‘test_theme’); do?
  53. Change Query Arguments (filter) with jQuery/Ajax or PHP?
  54. How to load previous or next attachment with jquery ?
  55. Validating an email input from form field before submit using JQuery, AJAX, and PHP
  56. WordPress cascading dropdown selection search based on Parent Page & Child Page
  57. Tracking Visitor LatLng with WordPress using JS, PHP. How to put data which was extract using JS into DB
  58. Ajax on the Administration Side of plugin – wp_localize_script – how to pass value from JQuery to PHP function in class?
  59. jquery & ajax getting data from php in wordpress . admin-ajax.php returns 400
  60. Failed to load resource: the server responded with a status of 500 (Internal Server Error) through wp_admin_ajax.php
  61. Ajax filter with loadmore button
  62. Admin-ajax.php 404 error
  63. How to pass values from one function to the other using an array variable
  64. How to change PHP variables with AJAX request in WordPress
  65. Update $wpdb query with AJAX
  66. AJAX to add to cart multiple products woocommerce
  67. wp_set_object_terms returns 500 error when called through AJAX function
  68. How can i send id of the currently posted form data through json response in custom wordpress plugin?
  69. Cannot successfully execute AJAX script to call function.php specific function. Using XAMPP localhost to test
  70. WordPress ajax filter returning all posts when it should be filtering by category
  71. Unable to update the meta boxes with multiple fields
  72. Input field duplicates on form submit by jQuery
  73. How to echo a PHP code into WooCommerce variation product?
  74. How can i get the same ajax result using WP REST API instead of admin-ajax?
  75. defined (‘ABSPATH’) false after AJAX post to other PHP-file
  76. Find the method which AJAX GET calls
  77. AJAX Filter WHILE Loop not working WordPress
  78. WordPress 404 when using AJAX to call php function
  79. wordpress ajax pagination
  80. how use php query in AJAX jquery
  81. Ajax Load more CPT via shortcode
  82. Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?
  83. Submitting my form to the database and then redirecting to payment site
  84. Pass the updated value of aid from form using ajax
  85. 500 (Internal Server Error) of external php file
  86. Use jQuery and AJAX to get HTML
  87. Adding instant search to wordpress page
  88. If custom field doesn’t exist, or exists and it’s true show title?
  89. Dynamic Gallery
  90. best way to communicate between php and jquery/javascript
  91. Loading a post’s content, into a div outside the loop, when it’s title is selected in a list
  92. Fatal error: Uncaught Error: Call to undefined function wp_nav_menu()
  93. AJAX: WordPress filters inside $html do not work as intended
  94. Why not showing all post by default in my jquery filter
  95. Jquery autosave text area after typing
  96. Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)
  97. notify users when changed database
  98. Save Edit button then disabled readonly metabox
  99. getJSON response to PHP
  100. Upload multiple files via ajax from an HTML file input
Categories PHP Tags ajax, jquery, metabox, php, post-meta
Custom Post Type Rewrite – Page Not Found
How do I fix feed error?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress