Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You could create a page which uses a custom template. Lacking more specific information, it’d query the table and output links and abridged information corresponding to each row. Essentially an archive listing of all relevant rows.

    The links could include an URL query string that specifies a specific row. When such information appears in a link, instead of listing all rows, the template code queries for just that one row and outputs complete information for that one row.

    For example, this would list all offers with links:
    https://example.com/job-offers/

    This would display all information for one specific row:
    https://example.com/job-offers/?offer_id=1234

    Thread Starter asmitta

    (@asmitta)

    I resolve the problem. What have i done ?

    • Create and register my custom post type, create a template for it.
    • Create a small code that creates a post for each of my jobOffers with these fields: wp_insert_post([?'post_content' => $jobOffer->description, 'post_title' => $jobOffer->label,?'post_excerpt' => substr($jobOffer->description, 75),?'post_type' => 'phenix_job_offer',?post_name' => sanitize_title($jobOffer->label),?'meta_input' => ['job_offer' => $jobOfferId] ]);
    • After that in my template i fetch the jobOffer with the post meta key ‘job_offer’ then render it as i want.
    • This reply was modified 1 year, 8 months ago by asmitta.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Create a page for each database custom table entries’ is closed to new replies.