Jetpack by WordPress.com
[resolved] Issue with List Category Posts plugin (11 posts)

  1. fernandobt
    Posted 1 year ago #

    Hi, I'm the developer of List Category Posts. Two users have reported an issue on the plugin's support forum regarding the "Sharing" functionality.

    TL;DR: When they use my plugin's functionality to display the excerpt or content for the listed posts, the sharing menu disappears.

    You can see the topic here.

    I'm really puzzled but I really want to fix this so that my plugin is compatible with Jetpack's sharing feature. Any help is really appreciated.



  2. Jeremy Herve
    Jetpack Mechanic
    Plugin Author

    Posted 1 year ago #

    Could you let me know how you call the post content and post excerpt when a site owner uses the excerpt=yes' or content=yes shortcode parameters?

  3. fernandobt
    Posted 1 year ago #

    Hello, thanks for answering.

    Here's the code for displaying the content, there is a filter and some processing going on:

    $lcp_content = $single->post_content;
          $lcp_content = apply_filters('the_content', $lcp_content);
          $lcp_content = str_replace(']]>', ']]&gt', $lcp_content);
          if ( preg_match('/[\S\s]+(<!--more(.*?)?-->)[\S\s]+/', $lcp_content, $matches) ):
            if( empty($this->params['posts_morelink']) ):
              $lcp_more = __('Continue reading &rarr;', 'list-category-posts');
              $lcp_more = '';
            $lcp_post_content = explode($matches[1], $lcp_content);
            $lcp_content = $lcp_post_content[0] .
              ' <a href="' . get_permalink($single->ID) . '" title="' . "$lcp_more" . '">' .
              $lcp_more . '</a>';
          return $lcp_content;

    For the excerpt I do some other processing:

    $text = strip_shortcodes($text);
        $text = apply_filters('the_content', $text);
        $text = str_replace(']]>',']]>', $text);
        if( $this->lcp_not_empty('excerpt_strip') &&
            $this->params['excerpt_strip'] == 'yes'):
          $text = strip_tags($text);

    Sorry for the crappy code paste :P

  4. Jeremy Herve
    Jetpack Mechanic
    Plugin Author

    Posted 1 year ago #

    Thanks! I've asked one of our developers to take a look, and I'll get back to you!

  5. Jeremy Herve
    Jetpack Mechanic
    Plugin Author

    Posted 1 year ago #

    Could you try to install this patched version of Jetpack, and let me know if this fixes your problem?


  6. deraltetom
    Posted 1 year ago #

    Dear Happiness Engineers,

    installing the new Version didn´t solve the Problem, but there are changes that may lead to the solution.

    Please see


    for further Details.

  7. Jeremy Herve
    Jetpack Mechanic
    Plugin Author

    Posted 1 year ago #

    Thanks for trying! We'll keep looking and I'll get back to you as soon as I have some news.

  8. Ben Lobaugh (blobaugh)
    Jetpack Engineer
    Plugin Contributor

    Posted 1 year ago #


    I looked into the code for Jeremy and the patch that was provided is working fine for both the content and the excerpt. In order to see the behavior you desire in your plugin you need to update CatList::lcp_trim_excerpt() to apply the_excerpt filters on http://plugins.trac.wordpress.org/browser/list-category-posts/trunk/include/CatList.php#L443 similar to how CatList::get_content() applies the_content filters.

    return apply_filters( 'the_excerpt', $text );

    Give that a try and let us know how it works out.

  9. deraltetom
    Posted 1 year ago #

    Hi everyone,

    first of all: I am only the user. On a scale from 1 to 10 my php-skills are around Zero. So maybe I got it all wrong and this is misleading.

    But I am afraid we are talking about different things in the moment.

    If I got it right, Ben´s Suggestion will lead to the jetpack sharing Buttons being shown at the end of each listed post (no matter whether the excerpt or the Content-command is used). But this is not the goal. In fact I would prefer these Buttons not to be shown (like it is in the regular Version of jetpack).

    The Goal is that the sharing Buttons are shown at the end of the page that contains the listing (test1). This neither works with the excerpt-command nor with the Content-command.

    Hope this helps.

  10. Ben Lobaugh (blobaugh)
    Jetpack Engineer
    Plugin Contributor

    Posted 1 year ago #

    Thanks for the feedback @deraltetom.

    The List Category Posts (LCP) developer, @picandocodigo, will need to work that into the LCP plugin. Jetpack does not control how LCP displays things. What Jetpack was doing at the beginning of this thread was actually a bug that has been resolved.

    Here is a chunk of code that can be used as a 100% untested guide ;)

    add_filter( 'jetpack_sharing_infinite_catch', '__return_false' );
    // Do LCP display stuff
    add_filter( 'jetpack_sharing_infinite_catch', '__return_true' );

    If my guess is correct that should hide the sharing button output on the LCP lists but still show it on the main content.

  11. fernandobt
    Posted 1 year ago #

    I just got working on the plugin for a while and I'm adding the correct filter on version 0.46. Jeremy, Ben, thanks a lot for your help!

    @deraltetom please update and check out that everything is working.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Jetpack by WordPress.com
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic