Remix WordPress Theme SLOW QUERY FIX

Remix WordPress Theme SLOW QUERY on Artists, Songs FIX

The problem occurs when you have medium size database. Query to database can take up to 30s, for artists songs.
The problem lies in /themes/remix/functions.php file more specific the related function which gives you all related songs/artists/lyrics/etc.
This is the actual function:


Database query is interpeded like this:

slow query remix theme artists
slow query remix theme artists

As you can see from above pic it’s a sad sad situation:)
We want to change that into this:

new query on remix wordpress theme artists
new query on remix wordpress theme artists

As you can see is an enormous improvement over this query. Here’s the updated function related(be awere that i didn’t need all post types, this is only for artists and songs, if you need something else you need to adapt it):


Of course after this we modified also single.php because it made unnecesary requests for us.
This is the original function:

As you can see there is a foreach.. If by some mistake user enteres lyrics for example in admin pannel there will be an aditional request,
so we get rid of user imput and place an array. You can place lyrics or whatever in that array so it can give you more results


By using above modifications your site loading time should improve considerably. Good luck!
Last modified: October 19, 2017