Open Graph data Destroy Page
-
When I opened Open Graph data, there were layout errors on the shopping cart page and the use of coupons prevented it from expanding properly!
I found a piece of code
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ /* Remove Yoast SEO OpenGraph Output From One Post/Page * Credit: Unknown * Last Tested: Apr 01 2017 using Yoast SEO 4.5 on WordPress 4.7.3 ********* * DIFFERENT POST TYPES * Post: Change 123456 to the post ID * Page: Change is_single to is_page and 123456 to the page ID * Custom Post Type: Change is_single to is_singular and 123456 to the 'post_type_slug' Example: is_singular( 'cpt_slug' ) ********* * MULTIPLE ITEMS * Multiple of the same type can use an array. Example: is_single( array( 123456, 234567, 345678 ) ) * Multiple of different types can repeat the if statement */ add_action('wp_head', 'remove_one_wpseo_og', 1); function remove_one_wpseo_og() { if ( is_page ( 7 ) ) { remove_action( 'wpseo_head', array( $GLOBALS['wpseo_og'], 'opengraph' ), 30 ); } /* Use a second if statement here when needed */ }
https://exp.com/wp-admin/post.php?post=7&action=edit
https://exp.com/cart/
Just a shopping cart page error!
After I added the code, it didn’t work properly!
Any help would be greatly appreciated!The page I need help with: [log in to see the link]
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Open Graph data Destroy Page’ is closed to new replies.