Last active
September 8, 2017 01:16
-
-
Save schemapress/96a723402681726029d59e1aeb8250a1 to your computer and use it in GitHub Desktop.
Override Knowledge Graph markup output https://schema.press
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //* do not include php tag | |
// First: we remove the Knowledge Graph markup | |
remove_filter( 'schema_wp_filter_output_knowledge_graph', 'schema_wp_do_output_knowledge_graph' ); | |
// Second: we output the Knowledge Graph markup everywhere on the website | |
add_filter( 'schema_wp_filter_output_knowledge_graph', 'schema_wp_do_output_knowledge_graph_71837615376457563' ); | |
/* | |
* Output Knowledge Graph markup, this function overrides Schema output | |
* so we can control where it should shown (not only the front page) | |
* | |
* @since 1.6.9.2 | |
*/ | |
function schema_wp_do_output_knowledge_graph_71837615376457563( $knowledge_graph ) { | |
if ( ! class_exists( 'Schema_WP' ) ) | |
return; // Schema not present | |
return $knowledge_graph; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment