get( 'disable_date_rich_snippet_pages' ) || ! $fusion_settings->get( 'disable_rich_snippet_faq' ) ) ) { return; } // Handle FAQ Archives. if ( is_post_type_archive( 'avada_faq' ) ) { global $wp_query; if ( $wp_query->posts ) { foreach ( $wp_query->posts as $faq ) { new Fusion_JSON_LD( 'fusion-faq', [ '@context' => 'https://schema.org', '@type' => [ 'WebPage', 'FAQPage' ], 'mainEntity' => [ [ '@type' => 'Question', 'name' => $faq->post_title, 'acceptedAnswer' => [ '@type' => 'Answer', 'text' => $faq->post_content, ], ], ], ] ); } } } if ( is_singular( 'avada_faq' ) ) { new Fusion_JSON_LD( 'fusion-faq', [ '@context' => 'https://schema.org', '@type' => [ 'FAQPage' ], 'mainEntity' => [ [ '@type' => 'Question', 'name' => get_the_title(), 'acceptedAnswer' => [ '@type' => 'Answer', 'text' => get_the_content(), ], ], ], ] ); } } } } /** * Instantiates the Fusion_Faqs class. * Make sure the class is properly set-up. * * @return object Fusion_App */ function Fusion_Faqs() { // phpcs:ignore WordPress.NamingConventions return Fusion_Faqs::get_instance(); } Fusion_Faqs();