parent
19c6b0fead
commit
b8d76baa99
|
@ -147,20 +147,21 @@ function wc_products_rss_feed() {
|
|||
|
||||
} elseif ( is_tax( 'product_cat' ) ) {
|
||||
|
||||
$term = get_term_by('slug', esc_attr( get_query_var('product_cat') ), 'product_cat');
|
||||
$term = get_term_by( 'slug', esc_attr( get_query_var('product_cat') ), 'product_cat' );
|
||||
|
||||
$feed = add_query_arg('product_cat', $term->slug, get_post_type_archive_feed_link( 'product' ));
|
||||
|
||||
echo '<link rel="alternate" type="application/rss+xml" title="' . esc_attr( sprintf( __( 'New products added to %s', 'woocommerce' ), $term->name ) ) . '" href="' . esc_url( $feed ) . '" />';
|
||||
if ( $term ) {
|
||||
$feed = add_query_arg( 'product_cat', $term->slug, get_post_type_archive_feed_link( 'product' ) );
|
||||
echo '<link rel="alternate" type="application/rss+xml" title="' . esc_attr( sprintf( __( 'New products added to %s', 'woocommerce' ), $term->name ) ) . '" href="' . esc_url( $feed ) . '" />';
|
||||
}
|
||||
|
||||
} elseif ( is_tax( 'product_tag' ) ) {
|
||||
|
||||
$term = get_term_by('slug', esc_attr( get_query_var('product_tag') ), 'product_tag');
|
||||
|
||||
$feed = add_query_arg('product_tag', $term->slug, get_post_type_archive_feed_link( 'product' ));
|
||||
|
||||
echo '<link rel="alternate" type="application/rss+xml" title="' . sprintf(__( 'New products tagged %s', 'woocommerce' ), urlencode($term->name)) . '" href="' . esc_url( $feed ) . '" />';
|
||||
|
||||
if ( $term ) {
|
||||
$feed = add_query_arg('product_tag', $term->slug, get_post_type_archive_feed_link( 'product' ));
|
||||
echo '<link rel="alternate" type="application/rss+xml" title="' . sprintf(__( 'New products tagged %s', 'woocommerce' ), urlencode($term->name)) . '" href="' . esc_url( $feed ) . '" />';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue