Support

Account

Home Forums General Issues Second slug/template for CPT with ACF Reply To: Second slug/template for CPT with ACF

  • Just to confirm that I understand correctly, on the job’s page you want a link to apply for the job?

    If that’s the case, why aren’t you passing the post ID of the job as a query variable (e.g. https://yoursite.com/apply-to-jobs/?job=YOUR_JOBS_POST_ID)?

    If you want a secondary slug for your jobs (so the URLs are prettier), it is possible to add an additional endpoint to existing URLs using add_rewrite_endpoint. If you were to go this route you could have a URL that looks like https://yoursite.com/job-a/apply/

    You would then use the template_redirect hook to load a different template that has a form (but you’d still be able to get the original job’s ID) so that you could inject the name of the job in the form.