Hello,
I’m having a weird performance issue with code I’ve rebuilt in L&L from my previous code in Custom Content Shortcodes. The result is the same, but the L&L code has huge performance issues and takes 6 to 8 seconds to run, while the code in CCS runs within one second.
Here are the code snippets. Is there anything I need to consider and change?
Note: I am using a custom post type called “weekly offers” and there are around 6,000 posts in it. So the dataset that is being worked through is quite large. But from my point of view this does not explain why it works so fast with CCS and not with L&L.
Code in CCS (runs here: Lokalitäten – PF-BITS Mahlzeit!):
[loop orderby=title type=wochenangebot field=jahr value=today date_format=Y field_2=kalenderwoche value_2=today date_format_2=W]
<div style="width: 120px; height: 150px; float: left; padding:14px;"><a href="[field author-url]"><img class="avatar photo" src="/wp-content/user/[field author-login].webp" alt="[field author]" width="120" height="120" /> [field author]</a></div>
[/loop]
Code in L&L (runs here: https://www.pf-bits.de/mahlzeit/testseite):
<Loop type="wochenangebot" field="jahr" field_value="{Date format=Y}" field_2="kalenderwoche" field_value_2="{Date format=W}">
<div style="width: 120px; height: 150px; float: left; padding:14px;"><a style="font-size: 12px;" href="{Field author_archive_url}"><img class="avatar photo" src="/wp-content/user/{Field author_name}.webp" alt="{Field author_full_name}" width="120" height="120" /> <Field author_full_name /></a></div>
</Loop>
Regards,
Besim