• Resolved kdmurthy

    (@kdmurthy)


    I am using another plugin which gets content for a custom post type using ajax. The check for is_single() in rendering_share method doesn’t allow this to pass through since is_single() returns false. Is there anyway to handle this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Heateor Support

    (@heateor)

    You can try using shortcode (details: https://support.heateor.com/sassy-social-share-shortcode-and-widget/)
    If this doesn’t help, let us know the url of problematic webpage so tat we can look into the situation.

    Thread Starter kdmurthy

    (@kdmurthy)

    Thanks. Adding shortcode is not an option in this case.

    The problem is with the following check @line 1343 of class-sassy-social-share-public.

    
                                            if ( isset( $this->options[$post_type] ) && ( is_single() || is_page() ) && isset( $post -> post_type ) && $post -> post_type == $post_type ) {
    

    As a workaround, I added a true || to the (is_single() || is_page()) and it is working well for me. The issue is that when we get the content using ajax, WPQuery::is_single returns false.

    Since custom post types can also be shown as a list, I think your code is correct. Mine looks like an edge case.

    Plugin Author Heateor Support

    (@heateor)

    Since custom post types can also be shown as a list, I think your code is correct. Mine looks like an edge case.

    Indeed.
    We will see if something can be done regarding this, in future releases.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Doesn’t add buttons when getting content using ajax’ is closed to new replies.