P2 - Bug when text is not included in an image or video only post (6 posts)

  1. saphrym
    Posted 6 years ago #

    This message is given if a title or some text is not included in a post in the P2 theme:

    Warning: strpos() [function.strpos]: Empty delimiter in /LOCATION/wp-content/themes/p2/functions.php on line 171

    This only happens on posts that have "..." as their title and have not had any form of text included in the post other than embed codes or IMG tags.

    Is there a way to fix this? My group is embed and image heavy and we're kind of tired of seeing this message. Our work around is to always include text or a title for the posts, but sometimes we forget.

  2. saphrym
    Posted 6 years ago #

    Ok. I replaced:

    $pos = strpos( $content, $title );


    if($title !='') {
        $pos = strpos( $content, $title );

    Seems to work fine now. Am I doing anything wrong? (Still new to PHP) And if that is a good fix, think it could go into the release? I did searches for the error including the line 171 part and WOW, there were a lot of results of people having the same problem.

  3. texet
    Posted 6 years ago #

    nice fix, thanks!! it seems ok to me. hopefully the developers will pick up this bug fix for the next release.

  4. ajita
    Posted 5 years ago #

    Wow, this worked for me as well, 7 months after saphrym found the fix for it. I guess the theme developers are ignoring this one.

  5. Did anyone actually report it to them?

  6. Lance Willett
    Posted 5 years ago #

    This fix is in the next P2 release, submitted this week to WordPress.org theme review.

Topic Closed

This topic has been closed to new replies.

About this Topic