Hi ctrlaltdelete
Yes, your theme or a plugin is using the gallery CSS selectors of the gallery to open them in a lightbox. You can change the class names with a filter, but it could mean you lose some styling for the gallery.
Try adding this to your theme’s functions.php file
add_filter( 'related_posts_by_taxonomy_gallery_item_class', 'rpbt_gallery_item_class' );
function rpbt_gallery_item_class($class) {
return 'rpbt-gallery-item';
}
btw:
consider creating a child theme instead of editing your theme directly – if you upgrade the theme all your modifications will be lost. Or create a plugin with the code above.
Hello i am using a child theme.
With that function they display one under the other (instead of side by side) but still show a lightbox when clicked.
Is there a way for me to make my own html from scratch? I only need post titles, permalink and thumbnail url. I’d like to do the rest myself if possible.
But i’m scared to lose the plugin cache which is a must else the query isn’t fast enough.
You could create a new template and format. Read more about it here
https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/templates/#create-format
How do you cache the related posts? With a cache plugin or with the plugin cache feature?
Perfect, that solves it. I can tweak to my needs now, no more light box.
I use this for caching:
add_filter( 'related_posts_by_taxonomy_cache', '__return_true' );
Oh good, the posts will still be cached if you create a new format. Btw. it also would be if you used plugins (like wp super cache) to cache your site.
Let me know if you need help with the new format or template.
The format is solved i think.
I got a slow query from the plugin that doesn’t go away even with caching enabled:
time varies from 0.05~0.1
get_crp_posts_id()
SELECT DISTINCT wp_posts.ID
FROM wp_posts
WHERE 1=1
AND MATCH (post_title,post_content) AGAINST ('Shin Megami tensei if...')
AND wp_posts.post_date < '2018-10-25 19:51:51'
AND wp_posts.post_date >= '2015-10-26 19:51:51'
AND wp_posts.post_status = 'publish'
AND wp_posts.ID != 115618
AND wp_posts.post_type IN ('post')
LIMIT 0, 6
I want to mention that my post_content is EMPTY i only use custom fields no content.
I also don’t use the post type ‘post’ and dates aren’t a factor, all posts are equally relevant. I don’t understand what this query is doing but can i speed it up or get rid of it?
That’s not a query from this plugin.
Amazing, i see. It’s my previous related post plugin. Close this before i embarrass myself even more.
No worries. Glad you’ve got it solved 🙂
And you shouldn’t be embarrassed to not know every query this plugin makes! It seems apparent you know what you are doing!