• Resolved kevinlau

    (@kevinlau)


    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!

    • This topic was modified 1 year, 1 month ago by kevinlau.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @kevinlau,

    Thanks for using the Yoast SEO plugin. If I understand correctly, your cart page had Open Graph errors, so you added the code snippet above to remove Open Graph metadata specifically from your cart page. Is that correct?

    • Can you let me know what errors you experienced that warranted using that code snippet?
    • After adding the code, can you let me know what you mean by it didn’t work properly? Are there errors on that page?

    I look forward to your clarification.

    Thread Starter kevinlau

    (@kevinlau)

    After I added the code, I didn’t filter the shopping cart page correctly!

    Plugin Support Maybellyne

    (@maybellyne)

    • What errors did you experience that warranted using that code snippet?
    • Please provide a detailed step to replicate filtering that isn’t working
    Thread Starter kevinlau

    (@kevinlau)

    https://share.vidyard.com/watch/FRALNcKdzGx4yQYYiUabtj?

    Hi, I recorded a video, maybe this way you can better understand the problem I encountered!

    Plugin Support Maybellyne

    (@maybellyne)

    Thanks for the screencast, @kevinlau. If I understand correctly, when the Open Graph data and Twitter card data features of the Yoast SEO are turned ON, the add coupon accordion doesn’t open to reveal the coupon code field.

    Are you using the default cart page by WooCommerce or is the cart page created with your theme, Savoy?

    Plugin Support Maybellyne

    (@maybellyne)

    This thread was marked resolved due to a lack of activity, but you’re always welcome to re-open the topic. Please read this post before opening a new request.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Open Graph data Destroy Page’ is closed to new replies.