How to make this ajax request work with WordPress?
- or -
Post a project like this1851
£50(approx. $62)
- Posted:
- Proposals: 7
- Remote
- #2321024
- Awarded
TOP 10 service providers on PPH: AngularJS |Saas|NodeJS|HTML 5 | PHP|Laravel|Codeigniter |CakePHP|ASP.NET|WordPress|Magento| iOS | Android |Hybrid App Development| SEO |
Chandigarh
WORDPRESS ( WOOCOMMERCE AND PLUGIN) AND CMS EXPERT - QUICKEST DELIVERY GURANTEED 12 + YEARS
Mohali
169480211958545243759914371904425742632622873
Description
Experience Level: Intermediate
Estimated project duration: 1 day or less
Aim: Using the WordPress plugin advanced custom fields I loop through the repeater field to display a list of people & information about them. When the site visitor clicks on a specific person, I want a modal/popup to appear, showing more details about them.
I have produced the list of people (see the uploaded image), in practice all of the images would be different people. When the user clicks on a person's image I need it to show the specific person's details, this is what I am struggling to do in ajax.
I am using:
- Bootstrap 3
- WordPress
- the WordPress plugin advanced custom fields
Using a repeater field in advanced custom fields, I output a list of people (with a small image, name & job title) . This looks like the image I upload with the 10 same faces on ( in practice these would be all different people not the same).
Then when the website user clicks on a specific person's image, I want a modal/popup to appear containing their name, job title, a bigger image of them (a seperate sub field from the smaller image) & a description of them.
To do this, I have used ` ` to get the row number of the person, & stored this in a & passed the number to jquery.
I am now struggling to produce a working ajax to pass this from jquery to php, so that it can be used in a 2nd advanced custom fields loop. I need this row number of the person to be passed into the 2nd advanced custom fields loop, so that the modal/popup displays the correct person's details.
I can provide my current code for the:
- page template
- the functions.php code (enqueue_script, localize_script & the php callback for the ajax)
- the jquery
I just didn't know how to include the code properly here. I can show you my code/ site by sharing my screen as well. I need a solution asap.
I have produced the list of people (see the uploaded image), in practice all of the images would be different people. When the user clicks on a person's image I need it to show the specific person's details, this is what I am struggling to do in ajax.
I am using:
- Bootstrap 3
- WordPress
- the WordPress plugin advanced custom fields
Using a repeater field in advanced custom fields, I output a list of people (with a small image, name & job title) . This looks like the image I upload with the 10 same faces on ( in practice these would be all different people not the same).
Then when the website user clicks on a specific person's image, I want a modal/popup to appear containing their name, job title, a bigger image of them (a seperate sub field from the smaller image) & a description of them.
To do this, I have used ` ` to get the row number of the person, & stored this in a & passed the number to jquery.
I am now struggling to produce a working ajax to pass this from jquery to php, so that it can be used in a 2nd advanced custom fields loop. I need this row number of the person to be passed into the 2nd advanced custom fields loop, so that the modal/popup displays the correct person's details.
I can provide my current code for the:
- page template
- the functions.php code (enqueue_script, localize_script & the php callback for the ajax)
- the jquery
I just didn't know how to include the code properly here. I can show you my code/ site by sharing my screen as well. I need a solution asap.
Matthew P.
100% (10)Projects Completed
11
Freelancers worked with
10
Projects awarded
38%
Last project
7 Dec 2019
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
Hey Mat, Morning! Thanks for the invite. Look like you have already hired someone. Best of luck. Cheers.
776384
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies