Your account expired support, please renew to get your support.

Home Forums Themes Support Claue Disable the output of Twitter cards and Open Graph

Topic Resolution: Resolved
Viewing 5 reply threads
  • Author
    Posts
    • #35873
      piatrou
      Support 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.

    • #35876
      Harry
      Support 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

    • #35885
      piatrou
      Support 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?

    • #35886
      piatrou
      Support 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 );
      }
    • #35892
      Harry
      Support 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

    • #35899
      piatrou
      Support Expired

      It works now. Thanks .

Viewing 5 reply threads

You must be logged in to reply to this topic.