/** Locate the site's existing package page without changing its database content. */ function dayva_packages_page() { foreach ( [ 'packages', 'package', 'internet-packages', 'internet-plans', 'plans' ] as $slug ) { $page = get_page_by_path( $slug ); if ( $page instanceof WP_Post ) { return $page; } } return null; } function dayva_packages_url() { $page = dayva_packages_page(); return $page ? get_permalink( $page ) : home_url( '/#packages' ); } /** Render the existing package page using Elementor when it was built with Elementor. */ function dayva_existing_packages_content() { $page = dayva_packages_page(); if ( ! $page ) { return ''; } if ( class_exists( '\\Elementor\\Plugin' ) ) { try { $content = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $page->ID, true ); if ( is_string( $content ) && trim( $content ) !== '' ) { return $content; } } catch ( Throwable $e ) { // Fall back to normal WordPress page content below. } } return apply_filters( 'the_content', $page->post_content ); } https://dayvaenterprisesltd.co.ke/index.php/product-category/uncategorized/