Hi there,
I’m using the “Page Links To” plugin to redirect some custom post types (created with ACF) to external sources. I also set Rank Math to automatically add the target=”_blank” attribute for external links to open them in a new tab.
Some of these posts don’t have links to external sources, but are left to open on the single post page directly on the site, so they are internal.
Using the TagDiv Module feature, I created a custom display for the specific post type (“Business”). Within it, I’ve added the “Module Read More Button” element and some custom CSS to display this button only for internally redirecting businesses:
https://prnt.sc/2t_nfnymDpep
CSS code used:
.tdb_module_read_more a[target="_blank"] {
display: none;
}
Everything is working properly until it comes to using any of the “Next Prev”, “Load More” or “Infinite Load” pagination:
- CSS code works for the first displays of businesses:
https://prnt.sc/cXfuEyCQbUYz
target=”_blank” attribute being correctly associated:
https://prnt.sc/0d92HKZkuAWR - Once pagination is used, the posts on the next page display the “Read more” button even if they are external:
https://prnt.sc/qVIj8VKGW3H2
target=”_blank” attribute disappearing:
https://prnt.sc/Hr5AnsgqSC3Q
This also happens and if go back to the first page, the target=”_blank” attribute disappears and the “Read more” buttons are displayed.
This doesn’t happen with the “Normal Numbered” pagination type, but that’s only available for the “Flex Loop Builder” element. If I want to use the “Flex Block Builder” (in order to filter the custom posts based on multiple terms), that pagination type is no longer available, so having to use one of the other three, causes the problem described.
I would really appreciate your support in solving this issue!
Thank you in advance!