your ajax url is wrong i think. ajax link should be admin_url( ‘admin-ajax.php’ ). That means
wp_localize_script('history_script', 'myAjax', array('ajaxurl' => get_template_directory_uri().'/functions.php'));
will be this
wp_localize_script('history_script', 'myAjax', array('ajaxurl' => admin_url( 'admin-ajax.php' ));
Related Posts:
- Getting the post_id in wp_ajax function
- Ajax posts filter by date, comments, top views, top likes
- Send post id through ajax and get the post content back
- AJAX load more posts not using correct category and repeating the same few posts
- How to get posts from network blog
- How to detect single.php (but not single-portfolio.php)?
- Changing the post date and time with function
- Get current post id in functions.php
- Dynamically add id to heading tags
- disable WP automatically inserted line breaks after an image
- How to publish a post with empty title and empty content?
- delete post also attachments
- How to call function within a page/post, to dynamically generate content?
- Restrict users from editing post based on the age of the post
- How do I use element instead of tags in WordPress post content having webP support?
- How to use oEmbeds on Post Content during AJAX requests
- Guest Author – How to modify my custom function code if the guest author URL will follow a particular pattern/format?
- Human Time Diff, change mins to minutes
- How to get new post URL?
- POST from jQuery to PHP
- Force update all posts in custom post type, no content changes
- Disable REST API for a user ROLE
- How to display post tags
- How to Display Post View Count
- Remove double space after a period
- Add confirmation popup on “Move to Trash”
- $post object is null
- WordPress theme ajax have_posts()
- The correct way to call posts with ajax
- How do I use Ajax to show the new posts realtime, on the frontpage
- How to change the page break URL from ../post/2 to …/post/page2/
- Disable single post page
- Run a function when post is deleted?
- AJAX filter posts by year
- Getting current post ID in functions.php
- Add icon/badge next to posttitle of specific category
- Add ajax load more function using WP API
- How to pass Post_ID variable from theme’s Single.php to custom Plugin using AJAX
- Ajax load more button in Recent posts widget
- Ajax Dynamic Archives not showing correct results
- Load post attached images on a single page site with fancybox
- Exclude category from
- Setting posts_per_page for taxonomy term template
- Change post order random through out the entire WordPress
- How to display the link (title) and thumbnail post?
- Can’t get buddypress notifications in front-end; why do I get this error?
- How do I display some posts fully on the homepage, and some as an excerpt only?
- Using ajax on editing a category edit page?
- Force authors to Preview a post before publishing
- Change all author links in Blog roll
- disable Tab post on nav-menus page (Admin)
- Format latest/newest post differently
- is_page Funtion for Posts ?
- Get post meta retrieving wrong value
- The_excerpt() doesn’t parse – how to change that?
- How to only publish posts with image in it
- Isn’t the way posts are displayed very unefficient?
- restrict incrementation of post vies count when refreshing the page
- WordPress notification if new post published
- Where Should i write the code for wordpress ajax voting?
- Call current post URL in ajax
- Using system date format
- Get post by tag
- Related Posts function not working
- the_content() Not Grabbing All Content
- saving/reading custom field value does not work – no value gets POSTed
- Internal linking to posts permalink fail because of spaces and stripe at postname
- Have h2 tag not show up if there are no blog posts
- WordPress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?
- How to implement a WordPress comments function?
- How to add content above footer in posts from specific category
- How to make ajax load posts from the current category?
- shortcode // get posts by ids
- Using AJAX to filter posts without refreshing page
- Find most used words in post titles
- $post->post_content empty while all other properties are correct
- How to create custom search form function including post “tags”
- how to filter posts by category without page load (ajax) in wordpress?
- Ajax: load content from post I clicked
- call to jquery ajax failing with 500 error when passing extra data field
- Many buttons not functioning in WordPress dashboard (as admin)
- Post data across WordPress sites
- Replace Tag Keyword With Link Within Post Content
- Ajaxify Post Sort
- How to correctly escape data
- Display author bio box
- Check if user has avatar
- Run function after post is updated
- When Author add new post change default status to pending
- fire action when post is being edited as well as saved?
- Get post id on click of thumbnail
- Getting rid of the blog page entirely
- How to use wp_editor(); in functions.php then retrieve content in the template
- Adding a time stamp on post view
- List direct children of page
- save_post not working
- Display a custom field rating system in the front end
- Custom Post-Rename Function Does Not Function in WordPress 6.x
- How to make ‘show_option_all’, that comes from wp_list_categoreis, to work with get_categories or with get_terms?
- How to sort posts alphabetically based on a specific parent category