Filter the provider according to the connected user

Hello,

After some research on the forum, I did not find any solution to my problem.

I have installed the “DW Q&A” plug-in and would like to display the questions of the connected user.

As the plug-in generates “posts” for the questions, I managed to make them appear with the Posts tool (provider / query builder).


The problem is that I want to apply a dynamic filter according to the ID of the user connected to the site.

Do you have a query that I can use in the provider?

Thanks to you :slight_smile:

Hi Richard,

Thanks for reaching out.
You need to use the Query String options instead of the Query Builder. In the Query String option you can pass the Dynamic Content using the Dynamic Content tag.
You can get a few examples of the Query String in the following thread.



I would also suggest you go through the following article on Query String.

Hope it helps.
Thanks

1 Like

Hello @tristup

Thank you for your suggestions that allowed me to write this request that I share with you:

post_type=question&posts_per_page=4&post_status=publish&ignore_sticky_posts=1&orderby=date&order=asc&author={{dc:user:id}}

However, this one only shows me one post (but I have two posts currently written with this same user ID)

I have integrated my query in “Query string” and activated the “looper consumer” on the children elements on “All” but nothing happens…

Did I forget something ?

Hello @Richardz,

In order to help you with your concern, we need to check your settings please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin level username and password
  • Exact page URL

You can find the Secure Note button at the bottom of your posts

Thanks

Hello @prakash_s

Here the details :

Hello @Richardz,

I checked your given page URL but I can not able to find any Looper setup and Query string. Please share the exact page URL and it would be best if you could share a screenshot as well so that we can check it at our end.

Thanks

@prakash_s here the good URL (it’s a global block)

Hey Richard,

The query string post_type=question&posts_per_page=4&post_status=publish&ignore_sticky_posts=1&orderby=date&order=asc&author={{dc:user:id}} is correct and it is working. Just make sure that the current logged in user has created a post.

Please check the example URL in the secure not below.

Kindly let us know how it goes.

Hi @ruenel

Thank you very much for your help and your intervention, however the problem remains unresolved.

As said before, the user account with which I test the site has two items (url in secure note)

However, on my example as on yours, there is only one article that appears on the “question” template:

Capture d’écran 2021-11-13 à 11.32.00
What parameter to the query (or elsewhere?) do I need to add to make ALL HIS questions appear for the logged in user?

Thank you very much in advance for your help, Richard.

Hey Richard,

The custom post tyope slug is dwqa-question. Your query string should be:
post_type=dwqa-question&posts_per_page=4&post_status=publish&ignore_sticky_posts=1&orderby=date&order=asc&author={{dc:user:id}}

Using two different query strings, I am getting this result:

View the live view of the page and do not rely on the result in the builder because you may have assigned a preview page while you are in the builder.

Best Regards.

1 Like

Thanks a lot for your help ! :slight_smile:

You’re welcome. Glad we’re able to help. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.