function custom_restricted_library_message() { // Check if the user is viewing the restricted library page $restricted_page_id = 79629; // Replace 123 with your library page ID if (is_home() && is_category('restricted')) { // Assuming 'restricted' is the category slug for the library // Custom message $custom_message = "This content is restricted. Please purchase our product to access the full library."; // URL to purchase product $purchase_url = "https://example.com/purchase/product"; // URL to purchase membership $membership_url = "https://example.com/membership"; // Output JavaScript for the popup ?>