Can’t assign review to custom post

[ad_1]

Are you using an existing theme or are you using your own theme?

When you use the assigned_posts="post_id" option on the shortcodes (or if you use the Block option to assign reviews to the current page), Site Reviews uses the Post ID of the global $post object.

If you are writing your own theme, make sure that you are using WP_Query correctly. For example, if using WP_Query outside of the The Loop, you need to make sure that you restore the original Post Data after your custom wp_query with wp_reset_postdata();.

Thread Starter
rudyyy

(@rudyyy)

I am using the Kadence theme.

The problem is not about showing the reviews on a specific page, but about assigning them in the first place.

So right now, my reviews are not assigned to any custom post because it couldn’t find one. However, regular posts like ‘hello world’ do show up in the search box under assigned post on the edit review page in admin area.

  • This reply was modified 18 minutes ago by rudyyy.

Ah.

Have you set exclude_from_search = true to your Custom Post Type?

If you have, then that custom post type will be excluded from the Assigned Posts search box on the admin pages.

Thread Starter
rudyyy

(@rudyyy)

Exclude from search was set to ‘true’. So should it be set to ‘false’?

Sorry, I meant to say exclude_from_search = true.

Since you set “exclude_from_search” to true, the custom post type is being excluded from the search results.

I’ll add a filter hook in the next version which you will be able to use to override it, but for now you would need to set exclude_from_search to false in order for your custom post type to be included in the search results.

Thread Starter
rudyyy

(@rudyyy)

That solved the issue. Thanks a lot!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer