• Hello,

    how to show related posts by a specific custom field attached to some post?

    I have a custom post type where i show single model pages and every model has related blog posts which i would like to show below every model page.

    I can’t find a way to do this. Right now it only works if adding the name of each model as a keyword to every model page inside the plugin’s meta box section where it says “keyword:”.

    However i will then have to make sure posts include this keyword inside the post title or main content of the post (what i don’t want).

    thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Ajay

    (@ajay)

    It depends on the kind of meta field. If this is ideally a one or two word field, you can add this in the Meta option under List tuning. This is used explicitly to narrow down the posts that are found by the plugin. I.e. if you have the field author that has the name of the author John, it will limit the posts to only those which have author John.

    Thread Starter romu85

    (@romu85)

    Hey,

    i already tried adding the meta key of the custom field “model_name” under the List tuning options. However it then won’t show any related posts below a model page at all.

    kind regards,

    Roman

    Plugin Author Ajay

    (@ajay)

    Are you able to check the queries generated on your pages? Assume it shows the related posts without the meta field and then with the meta field it breaks down?

    Thread Starter romu85

    (@romu85)

    Yes. It shows related posts to a single model page but somehow i can’t find a way to limit these results to only show the posts which contain the same field value added as entered under the keyword section for the relevant model page.

    I tried to use a tag instead and gave the post a tag of the model name but that does’t seem to work either. It then won’t show any related posts.

    Also I am not sure if having to use both “Only from” and “Related Meta Keys”.

    Post:

    Model:

    List Tuning:

    • This reply was modified 1 year, 5 months ago by romu85.
    Thread Starter romu85

    (@romu85)

    Think i got it, you have to select the option to turn off contextual matching under “List tuning” options.

    Thanks for the help ??

    Thread Starter romu85

    (@romu85)

    Hey,

    One more question. Is it possible to have paginated results for the output of related posts? Back, Next buttons or 1,2,3… if the number of related posts is greater than the allowed limit it shows by default.

    best regards

    Plugin Author Ajay

    (@ajay)

    You’ll need to do this via a custom install because the plugin doesn’t have that inbuilt.

    It will be one of the many features in my premium version that I’ll be developing over the course of the next several months.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Display related posts by custom field’ is closed to new replies.