`; }); jQuery('#events-suggestions').html(eventsHTML); jQuery('.viewAllLink').show(); } else { jQuery('#events-suggestions').html('
No events found.
'); jQuery('.viewAllLink').hide(); } // Speakers if (data.message.speakers && data.message.speakers.length > 0) { data.message.speakers.forEach(function(speaker) { var profileImageURL = speaker.profile_image ? `https://image.coinpedia.org/app_uploads/profile/${speaker.profile_image}` : 'https://image.coinpedia.org/app_uploads/profile/default.png'; speakersHTML += `
`; }); jQuery('#professional-suggestions').html(speakersHTML); jQuery('.view_professional').show(); } else { jQuery('#professional-suggestions').html('
No professionals found.
'); jQuery('.view_professional').hide(); } // Organizers if (data.message.organizers && data.message.organizers.length > 0) { data.message.organizers.forEach(function(organizer) { var defaultImageURL = organizer.company_logo ? `https://image.coinpedia.org/app_uploads/profile/${organizer.company_logo}` : 'https://image.coinpedia.org/app_uploads/profile/default.png'; organizersHTML += `
`; }); jQuery('#companies-suggestions').html(organizersHTML); jQuery('.view_company').show(); } else { jQuery('#companies-suggestions').html('
No companies found.
'); jQuery('.view_company').hide(); } } }, error: function() { jQuery('.loader').hide(); console.error('Failed to fetch data.'); } }); // Fetch resources jQuery.ajax({ url: 'https://coinpedia.org/wp-admin/admin-ajax.php', method: 'POST', data: { action: 'fetch_resources', query: query }, success: function(response) { let resources; try { resources = JSON.parse(response); } catch (e) { console.error('Failed to parse JSON response:', response); return; } let resourceHTML = ''; if (resources.error) { jQuery('.resourcenotfound').show().text(resources.error); } else if (resources.length > 0) { resources.forEach(function(resource) { resourceHTML += `
`; }); jQuery('#resource-suggestions').html(resourceHTML); jQuery('.viewAllPosts').show(); } else { jQuery('#resource-suggestions').html('
No posts found.
'); jQuery('.viewAllPosts').hide(); } }, error: function(xhr, status, error) { console.error('AJAX request failed:', status, error); } });}jQuery(document).ready(function($) { $('.tab-item').on('click', function() { var tabId = $(this).data('tab'); $('.tab-item').removeClass('active'); $(this).addClass('active'); $('.tab-content').removeClass('active'); $('#' + tabId).addClass('active'); }); $(document).click(function(event) { if (!$(event.target).closest('.custom-search-container').length) { $('.suggestions').hide(); } });});
Log In to View Notifications.
Log in to access your notifications and stay updated. If you’re not a member yet, Sign Up to get started!