Want Page ID in post_id Field (1 post)

  1. abdul.mannan
    Posted 1 year ago #

    Hi every one.

    First of all, many thanks to author for such a nice plugin i.e ACF.

    Actually i ran into a problem and didn’t get the proper solution over internet that’s why posting this as a last Hope. Using ACF version

    What i want is explained below.

    I have 4 pages say A,B,C and D. I also have a custom post type say Products.

    Now what i want is to have an option in custom post type while adding the product to make that product featured on page A,B,C or D.

    So i have created the custom field with multiple select option and set 4 options that are A,B,C,D with page-ids as there values.

    Suppose i have a product with id 123 and assigned it to page A(page-id=10).
    So while displaying the page A, what should i exactly do to retrieve that post and displays that.

    Because what i have in database is like

    post_id = 123
    meta_key = test
    meta_value = a:1:{i:0;s:3:”10″;}

    where 10 is the page id.

    So i need a query or something , to show post_id 123 on page with id 10.

    According to my logic, i want the the record in database something like

    post_id = 10
    meta_key = test
    meta_value = a:1:{i:0;s:3:”123″;}

    So that when i am on page(id = 10), i will get the meta_value and then process a loop to get the product id.

    Please help.
    Thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic