Home › Forums › Themes Support › Claue › Disable the output of Twitter cards and Open Graph
- This topic has 5 replies, 2 voices, and was last updated 4 years ago by piatrou.
-
AuthorPosts
-
-
April 6, 2020 at 6:10 am #35873piatrouSupport Expired
How can I disable the output of Twitter cards and Open Graph which is built into the theme?
It does not work correctly on product categories and product tags. Invalid page name, missing description. I checked the demo and the same thing there.
I prefer to use a third-party plugin if you do not plan to fix this in the next topic update.
-
April 6, 2020 at 11:48 am #35876HarrySupport Expired
Hi,
Please add below code to claue-child > functions.php
add_action( 'wp_head', 'remove_my_action' ); function remove_my_action(){ remove_action( 'wp_head', 'jas_claue_social_meta', 0 ); }
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
April 6, 2020 at 3:12 pm #35885piatrouSupport Expired
Hi
I added your code to claue-child > functions.php
In HEAD section on the product, category, and tag pages is still displayed Itemprop, OpenGraph and Twitter Cards.
Any other suggestions?
-
April 6, 2020 at 3:23 pm #35886piatrouSupport Expired
My claue-child > functions.php
<!--?php // Подключение стилей родительской темы<br ?--> add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' ); function enqueue_parent_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); } // Удалить сообщение Товар добавлен в корзину add_filter( 'wc_add_to_cart_message_html', '__return_null' ); // Allow HTML in term (category, tag) descriptions foreach ( array( 'pre_term_description' ) as $filter ) { remove_filter( $filter, 'wp_filter_kses' ); if ( ! current_user_can( 'unfiltered_html' ) ) { add_filter( $filter, 'wp_filter_post_kses' ); } } foreach ( array( 'term_description' ) as $filter ) { remove_filter( $filter, 'wp_kses_data' ); } // Убираем вывод Open Graph и Twitter Cards от Claue add_action( 'wp_head', 'remove_my_action' ); function remove_my_action(){ remove_action( 'wp_head', 'jas_claue_social_meta', 0 ); }
-
April 6, 2020 at 4:38 pm #35892HarrySupport Expired
Hi,
Please change code to
if ( ! function_exists( 'jas_claue_social_meta' ) && ! function_exists( 'wpseo_activate' ) && ! class_exists('RankMath') ) { function jas_claue_social_meta() { return false; } add_action( 'wp_head', 'jas_claue_social_meta', 0 ); }
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
April 6, 2020 at 4:47 pm #35899piatrouSupport Expired
It works now. Thanks .
-
-
AuthorPosts
You must be logged in to reply to this topic.