[{"data":1,"prerenderedAt":151},["ShallowReactive",2],{"post:get-url-job-listings-page":3},{"id":4,"title":5,"body":6,"date":138,"description":139,"draft":140,"extension":141,"meta":142,"navigation":143,"path":144,"seo":145,"stem":146,"tags":147,"__hash__":150},"posts\u002Fposts\u002Fget-url-job-listings-page.md","TIL: How to get the URL of a Job Listings page",{"type":7,"value":8,"toc":136},"minimark",[9,21,24,41,57,68,71,132],[10,11,12,13,20],"p",{},"After installing ",[14,15,19],"a",{"href":16,"rel":17},"https:\u002F\u002Fwpjobmanager.com\u002F",[18],"nofollow","WP Job Manager"," on a careers-focused Wordpress site, I needed to set up a job search form. This search form would allow users to enter in a job title, keyword, etc to search the jobs on the site. Clicking \"Go\" would bring them to the job listing page.",[10,22,23],{},"Aha, but where IS that proverbial Job Listings page? This page URL can be altered through the WP Job Manager settings, so you shouldn't hardcode it! The answer lay buried in source code for the \"Jobs Page\" setting.",[10,25,26,27,36,37,40],{},"To get the ID of the job listings page, use the ",[14,28,31,35],{"href":29,"rel":30},"https:\u002F\u002Fdeveloper.wordpress.org\u002Freference\u002Ffunctions\u002Fget_option\u002F",[18],[32,33,34],"code",{},"get_option"," function"," for the ",[32,38,39],{},"job_manager_jobs_page_id"," option:",[42,43,48],"pre",{"className":44,"code":45,"language":46,"meta":47,"style":47},"language-php shiki shiki-themes github-light github-dark","$jobsPageID = get_option( 'job_manager_jobs_page_id' );\n","php","",[32,49,50],{"__ignoreMap":47},[51,52,55],"span",{"class":53,"line":54},"line",1,[51,56,45],{},[10,58,59,60,67],{},"To get the permalink of the job listings page, use the ",[14,61,64,35],{"href":62,"rel":63},"https:\u002F\u002Fdeveloper.wordpress.org\u002Freference\u002Ffunctions\u002Fget_permalink\u002F",[18],[32,65,66],{},"get_permalink",".",[10,69,70],{},"Wrapping it all up, here's the search form:",[42,72,76],{"className":73,"code":74,"language":75,"meta":47,"style":47},"language-html shiki shiki-themes github-light github-dark","\u003Cform method=\"GET\" action=\"\u003C?php echo get_permalink(get_option( 'job_manager_jobs_page_id', false )); ?>\">\n...\n\u003C\u002Fform>\n","html",[32,77,78,116,122],{"__ignoreMap":47},[51,79,80,84,88,92,95,99,102,104,107,110,113],{"class":53,"line":54},[51,81,83],{"class":82},"sVt8B","\u003C",[51,85,87],{"class":86},"s9eBZ","form",[51,89,91],{"class":90},"sScJk"," method",[51,93,94],{"class":82},"=",[51,96,98],{"class":97},"sZZnC","\"GET\"",[51,100,101],{"class":90}," action",[51,103,94],{"class":82},[51,105,106],{"class":97},"\"",[51,108,83],{"class":109},"s7hpK",[51,111,112],{"class":97},"?php echo get_permalink(get_option( 'job_manager_jobs_page_id', false )); ?>\"",[51,114,115],{"class":82},">\n",[51,117,119],{"class":53,"line":118},2,[51,120,121],{"class":82},"...\n",[51,123,125,128,130],{"class":53,"line":124},3,[51,126,127],{"class":82},"\u003C\u002F",[51,129,87],{"class":86},[51,131,115],{"class":82},[133,134,135],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s7hpK, html code.shiki .s7hpK{--shiki-default:#B31D28;--shiki-default-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic}",{"title":47,"searchDepth":118,"depth":118,"links":137},[],"2018-04-19T09:45:41-04:00","After installing WP Job Manager on a careers-focused Wordpress site, I needed to set up a job search form. This search form would allow users to enter in a job title, keyword, etc to search the jobs on the site. Clicking \"Go\" would bring them to the job listing page.",false,"md",{},true,"\u002Fposts\u002Fget-url-job-listings-page",{"title":5,"description":139},"posts\u002Fget-url-job-listings-page",[148,149],"wordpress","til","ACHVQusW51bVW4DI9Q9spf7p23CXlU22I8Ye9a1-Shw",1790471528299]