• <a href=""><?php  echo get_post_meta($post->ID,'mood-one', true); ?></a>

    I want to show all the posts with same meta value when the viewers click on the meta value and also want it to be searchable …

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I suggest creating a specific page to handle this that your link’s href attribute would point to. This page can be based on a custom template that’ll output what you desire. The attribute value will need to pass the related meta value or meta ID as part of the URL’s query string.

    The custom template can then query for all posts with the same passed value or ID, then list all posts found with the query.

    This template can also include a search field. The related form can submit to the same page. If the URL query string includes a search parameter along with a meta value or ID, include the search term as part of the query being made.

Viewing 1 replies (of 1 total)
  • The topic ‘Show all post with same post_meta value’ is closed to new replies.