Taxonomy Troubles

So I’m in a bit of a pickle. At the end of my film/TV review page, I have a section called “Even More Reviews,” which essentially updates itself to the latest reviews, like so.

Now, let’s take the first link for example. If I AM ALREADY on the “Good Boy: Review” the post looper will also continue to show “Good Boy” as a recommendation. What I’m trying to get at is… is there a way to make an exception in the looper to access all review links, except for the link of the custom post I’m currently on?

Hello Ankit,

Thanks for writing to us.

To help you with your concerns, please share more information or a screen recording video so we can check it. I would also request please share the admin login details meanwhile, I would suggest you troubleshoot a few of the common issues before we investigate 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

Not sure how best to upload a screen recording, although I can definitely provide a secure note. The only thing I’m looking for is:

How best to make it so the looper consumption of the custom post type (in this case, “Review,” as provided via “Query Builder”) avoids extracting a link/data of a review if the said review is the SAME as the page we’re on. This could help make the whole process slightly more intuitive.

Hello Ankit,

It seems that you want to exclude the current post from the “Even More Reviews” section. I would suggest you please set the Looper provider as a Query String and insert this query.

  post_type=review&post__not_in%5B0%5D={{ post.id }}&posts_per_page=3&offset=0&ignore_sticky_posts=1 

Hope it helps
Thanks

It really does!

Would it be possible to let me know what this means?

&post__not_in%5B0%5D={{ post.id }}

I think I’m able to understand roughly the commands of the other parts—ignoring sticky posts, cpt is a review, and 3 posts per page.

Just so that if I’m replicating it for the post looper below “Even More Reviews” I can understand what I’m typing lol

Thanks
Ankit

EDIT: also, if I need the looper to provide from more than 1 post type, how would I go about it? “post_type=opinion&post_type=obsession”?

Hello Ankit,

The post__not_in is WordPress query parameter which used to exclude the posts by using the post ID. The dynamic content code of Cornerstone to get the current post ID. Dynamic content code to get the current post ID
{{ post.id }}

In case you want to pull multiple cutom post type posts The Wordpress query would be like this.

$args = array(
'post_type'              => array( 'obsession','review' ),
'post__not_in' => array(15),
'posts_per_page' => 6
);

echo http_build_query($args);

Query String

  post_type%5B0%5D=obsession&post_type%5B1%5D=review&post__not_in%5B0%5D={{ post.id }}&posts_per_page=6 

Hope it helps
Thanks

Slightly better understand the structure now, thanks. I should now be able to (at the very least) try and piece my way through how best to make a query string lol.

Thanks so much! I know you didn’t necessarily need to break it down for me, and you still did. I’m eternally grateful.

You are most welcome Ankit.

Can I ask a follow-up question to this?

Let’s say I have a custom Taxonomy called “Franchises” and I want to use the same “Even More Reviews” Looper, except I:

  1. Only want it to show when I have (any) franchise selected from the list of Franchise… terms
  2. If the current film review is part of a franchise, I only want to show the last 3 reviews from ONLY films of that franchise.