Fix for bad paragraph code in listing-listview.php template

This topic contains 2 replies, has 3 voices, and was last updated by  Stiofan O’Connor 9 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #31592

    creativemms
    Free User
    Post count: 5

    On line 105 to 107 in listing-listview.php, the excerpt generated will have one of two problems: 1. Paragraph tag within a paragraph tag, since the_excerpt() creates its own tags, or 2. Creating an unwanted empty paragraph tag when there is no excerpt.

    I fixed by changing to:

    
    
    <div class="geodir-entry-content">
    if( isset( $character_count ) && ( $character_count || $character_count=='0' ) ) {
    	echo '<p>', geodir_max_excerpt($character_count), '</p>';
    }
    else { 
    	the_excerpt(); 
    }
    </div>

    This file could also using some serious cleaning up (proper indenting, etc) and comments.

    #31595

    Guust
    Moderator
    Post count: 29970

    Can you send us a URL of a page where that error shows in the source code?
    I cannot quite confirm the problem.

    #31630

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hello and thanks for the feedback.

    I see the extra p tags, i have change the_excerpt(); to echo get_the_excerpt(); i also changed the geodir_max_excerpt() function to return rather than echo.

    You can see all the latest changes in our dev version here: https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory-templates/listing-listview.php#L125

    feel free to submit bugs or add any pull request there also

    Thanks,

    Stiofan

Viewing 3 posts - 1 through 3 (of 3 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket