The SEO Framework compatibility code snipet
-
Please add the code snipet below in order to add compatibility with The SEO Framework plugin in your future releases:
`// Fix The SEO Framework
if ( defined(‘THE_SEO_FRAMEWORK_VERSION’ ) ) {
add_filter( ‘the_seo_framework_title_from_custom_field’, array( $this, ‘theseoframework_title’ ) );
add_filter( ‘the_seo_framework_custom_field_description’, array( $this, ‘theseoframework_metadesc’ ) );
add_filter( ‘the_seo_framework_rel_canonical_output’, array( $this, ‘theseoframework_url’ ) );
}public function theseoframework_title() {
return get_post_meta( wc_get_page_id( ‘onsale’ ), ‘_genesis_title’, true );
}public function theseoframework_metadesc() {
return get_post_meta( wc_get_page_id( ‘onsale’ ), ‘_genesis_description’, true );
}public function theseoframework_url( $url ) {
if ( !is_shop() ) {
return $url;
}
return get_permalink( wc_get_page_id( ‘onsale’ ) );
}
- The topic ‘The SEO Framework compatibility code snipet’ is closed to new replies.