• Hi Abu!
    Thanks for the plugin.
    I need to display reviews based on title instead of id, is that possible?
    I could echo the shortcode, but i do not know how to get the id based on the page_title.

    Think this is possible using your plugin?
    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Abu Bakar

    (@absikandar)

    Hi Abdullah,

    I did not completely understand your question.

    If you use page ID instead of page title, don’t you get the correct results?

    Please show me the the page where you are trying to echo the shortcode.

    Thread Starter Abdullah Ali

    (@abdullahalii)

    Hi again, and thanks for your reply.
    Sorry if i was not clear.
    I will use the shortcode outside WooCoommerce pages in a page with a title that is identical to a Product title. So, instead of:
    [twb_wc_reviews product_id="57" number="5"]
    I have:
    $mytitle = get_the_title();
    and would like to do:
    [twb_wc_reviews product_title=$mytitle number="5"]
    If this is not possible or not easy, i could probably add another variable $prod_id and assign it to the shoercode.
    I just failed to get the product id based on product title.

    P.S: Website is local and not online yet.

    Plugin Author Abu Bakar

    (@absikandar)

    You could also get the ID using get_the_ID()

    Did you try this?

    Thread Starter Abdullah Ali

    (@abdullahalii)

    but get_the_ID() retrieves the current post id.
    It seems like i will need to run a query that would retrieve the ID of the first product where title = current title. I am not a coder, but i could follow leads.

    While i am at it, i wish you would implement a way to retrieve reviews based on title, and review rating.

    Thanks a lot for your time.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using page title instead of idH’ is closed to new replies.