Skip to content

Instantly share code, notes, and snippets.

@pavlo-bondarchuk
Created October 2, 2018 16:05
Show Gist options
  • Save pavlo-bondarchuk/a96dacafb02a215a078a3169ca8012fa to your computer and use it in GitHub Desktop.
Save pavlo-bondarchuk/a96dacafb02a215a078a3169ca8012fa to your computer and use it in GitHub Desktop.
get yoast description, title, focuskw in tax-product_category / profiteh
<?php
if ( is_tax() ) :
$taxonomy = get_queried_object()->taxonomy;
$term_id = get_queried_object()->term_id;
$meta = get_option( 'wpseo_taxonomy_meta' );
$title = $meta[$taxonomy][$term_id]['wpseo_title'];
$desc = $meta[$taxonomy][$term_id]['wpseo_desc'];
$focuskw = $meta[$taxonomy][$term_id]['wpseo_focuskw'];
//printf( '<pre>%s</pre>', print_r( get_option( 'wpseo_taxonomy_meta' ), 1 ) );
// if ( isset($meta) && !empty($title) ) :
// echo apply_filters( 'the_title', $title );
// else :
// single_term_title();
// endif;
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment