Loop Issues results in Multiple Log Into Patreon Sections
-
I modified /classes/patreon_frontend.php and added the following code inside the if hide content loop because my theme uses the_content to render the header and footer. That caused the patreon button to appear multiple times on the page and looked bad.
The original code was:
if ( $client_id ) { $content = self::displayPatreonCampaignBanner( $patreon_level, $lock_or_not ); $content = apply_filters( 'ptrn/post_content', $content, $patreon_level, $user_patronage, $lock_or_not ); return $content; }
It is now:
if ( $client_id ) { // Make sure only the main content loop is modified if ( is_singular() && is_main_query() && !in_the_loop() ) { return $content; } $content = self::displayPatreonCampaignBanner( $patreon_level, $lock_or_not ); $content = apply_filters( 'ptrn/post_content', $content, $patreon_level, $user_patronage, $lock_or_not ); return $content; }
- The topic ‘Loop Issues results in Multiple Log Into Patreon Sections’ is closed to new replies.