Support » Plugins » [Plugin: Posts per Cat] Problems with Excerpts

  • Hi, anyone willing to listen.

    I’ve installed the PPC-plugin, and it works flawlessly; except for one minor detail; the excerpts. Neither when I choose “for all” or “for first”, any excerpt shows.

    I’ve been looking at, and to small amounts modified, the code. For one thing, I translated the comments and one variable name to English (GT said it was croation, is that correct?), to make it easier for us at my company to maintain the app we’re building.

    Anyhow, has anyone else experienced this bug, and is there a workaround? I’m not so keen on messing around in other people’s data-structures, so modifying that without guidance feels like a big no-no.

    Best regards

    Rickard Lund

Viewing 5 replies - 1 through 5 (of 5 total)
  • I can add to this that the “summary” (excerpt) is printed properly. Though, it’s an empty string.

    I verified this by concatinating in two !! into the echo of it.

    This leads me to think that there might have something to do with the parameters:

    if ( $ppc_excleng && mb_strlen_dh($clanak->post_excerpt) > ($ppc_excleng+1) ) { $summary = substr_utf8($clanak->post_excerpt, 0, $ppc_excleng)."…"; } else { $summary = $clanak->post_excerpt;}

    I would like to know; where does $clanak->post_excerpt come from? Is that a wordpress-parameter? ($clanak means “$post” or “$article”, by the way).

    OffTopic: I must to translate all comments and vars to English (not it’s in Serbian) 🙂

    OnTopic: $clanak->post_excerpt is almost same as function the_excerpt(), but returns excerpt content to string, don’t print it out.

    $clanak means $post, and post_excerpt is field from table wp_posts.

    I too have had this issue, but I don’t understand the author’s answer. Do I need to adjust the code or are the excerpts simply not going to show up?



    Hi, tried my hands on this plugin yesterday. Don’t know if your problem was mine, but in my case WordPress 3.1 doesn’t automatically create the content for post_except field in the database, so the querry for post_excerpt field returns an empty string.

    To solve the problem, you could turn Excerpt field on in the Screen View option panel for your posts and create the Excerpt manually.

    If you don’t want to going through that all the time, then go to line 328 and replace this:
    if ( $ppc_excleng && mb_strlen_dh($clanak->post_excerpt) > ($ppc_excleng+1) ) { $sazetak = substr_utf8($clanak->post_excerpt, 0, $ppc_excleng)."…"; } else { $sazetak = $clanak->post_excerpt;}

    with this:
    if ( $ppc_excleng && mb_strlen_dh($clanak->post_content) > ($ppc_excleng+1) ) { $sazetak = substr_utf8($clanak->post_content, 0, $ppc_excleng)."…"; } else { $sazetak = $clanak->post_content;}

    That would make the plugin take content in “post_content” field in stead of post_excerpt field to process, so you won’t have to bother with post_excerpt every time.

    Good luck!

    What about new option in settings to use post_content in stead of post_excerpt w/o code hacking?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Posts per Cat] Problems with Excerpts’ is closed to new replies.