Cyber Week Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Resolved] Blockquote and Tables tags converting in GeneratePress

Home Forums Support Blockquote and Tables tags converting in GeneratePress

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #142151
    CatPerson

    Here’s a weird one. I have many posts with blockquotes and tables. When I switch themes to GeneratePress, the theme actually converts the html for

    to <p></p>, and for <td></td><tr> and </tr> to <br>. The one exception is in a sticky post (does GeneratePress even support those?) – a blockquote in the sticky post remains a blockquote. When I revert to the theme I was using before (old version of Shades of Blue), all the blockquote and tables tags are restored, and work normally. I have gone back and forth several times, viewing the source with each theme, and the conversions and reversions are consistent.

    The site is confidential and password-protected, so I can’t post a url. However, I’d be happy to email you my css customizations in case I’ve done something I shouldn’t have. I built the site before I knew much about WP, and made all kinds of direct changes to theme files. I don’t think I made any changes to the WP installation, since I’ve kept it current, and the site hasn’t changed when I updated, but I can’t swear to it. Can you think of anything that might cause this bizarre behavior?

    Oh, and also, how can I turn off automatic truncation of posts? I want all posts to appear full length on blog pages.

    #142214
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I can’t see the first part of your code – what’s being turned into those HTML tags?

    GeneratePress doesn’t touch any of the code that deals with the content editor, and I’ve never experienced this/had others report it, so I assume it may be a plugin you’re using.

    Can you try #1 on this page?: https://generatepress.com/knowledgebase/debugging/

    If that doesn’t work, our next best bet if I can’t see the site is if you can do a quick video/screencast so I can see the process.

    Let me know 🙂

    #142702
    CatPerson

    Doh, should’ve tried another theme straight off. Having the same problem with blockquotes and tables in the 2015 theme, so it’s not GeneratePress. I checked out so many themes before I got into customizations with GeneratePress, I assumed I’d have noticed the same problem in others. However, I now realize there are no tables on the front page, so possibly every theme I tried had the same problem, and I just didn’t see it.

    The code you couldn’t see in my first post was the opening and closing tags for a blockquote. Clearly they work just fine here 🙂

    I have refined my understanding of both the problem displaying tables and blockquotes, and the automatic truncation of posts. They are related, and both occur only on search results pages. Instead of the full post showing, there is a truncated excerpt, and the excerpts are stripped of blockquote and table tags (and possibly others that I just haven’t missed). This occurs in GeneratePress and in 2015, but not in the old version of Shades of Blue we currently use. Shades of Blue was last updated in 2009, and we aren’t even using the current version (I know, I know, but it’s a private site, so I figured the risk was low).

    So, not your issue, obviously, but any insights you may have are welcome. Deactivating my plugins didn’t make a difference. Since it’s occurring across multiple themes, I’m assuming I messed up something in my WordPress installation at some point, but if that’s it, am baffled at why my changes weren’t overwritten long since by updates. Should the search results page be showing excerpts, even though I have “full text” selected on the Settings/Reading page?

    #142721
    Tom
    Lead Developer
    Lead Developer

    You can choose to show the full content on your blog by going to “Customize > Blog > Blog Content” and setting it to “Full post”.

    You can also keep it as displaying excerpts, and set a more tag in specific posts to tell the Blog where to set the cut off – this will make it so the HTML above the more tag displays: https://generatepress.com/knowledgebase/using-the-more-tag/

    Let me know if that helps or not 🙂

    #142921
    CatPerson

    No, that didn’t work. I already had it set to full posts, and on the blog page (which is also the front page), full posts with correct formatting are displayed. The problem occurs on search results pages.

    Problem 1). Only excerpts of each post appear in the search results. We don’t want this. The sole purpose of this site is to distribute documents to remote executives, so the “posts” are just document descriptions with a download link to the document. There is no reason to make them click through an excerpt to a post page, as the posts are short, and the post they are looking for will almost always be the first or second one in the search results. I want them to be able to see full posts in search results.

    Problem 2). Formatting (such as blockquotes, tables and links) are stripped from the excerpted text. Even if they can see the full text of a post within the excerpt, blockquote and tables tags (which are my standard formatting for certain types of information I routinely transmit along with documents) are stripped out. The link tags are also stripped out, so users have to click through to the post page before they can download.

    Should this be happening? That is, is this default WordPress behavior in search results? I’m about to set Wordfence loose on the installation, plugins and themes, since it can match my files to what they’re supposed to be. I’ll let you know how that turns out,

    #142961
    Tom
    Lead Developer
    Lead Developer

    Ah, search results in GP show the excerpt by default.

    In the next version of GP, there’s a simple filter we can use to override this and choose when to show/hide the excerpt more freely.

    For now, you could place this file in your child theme: https://gist.github.com/generatepress/a12b5d716938324ed1a1

    Just be sure to name it “content-search.php”.

    Let me know if you have any questions 🙂

    #148733
    Chris

    Any news on this?
    Also i would be very much interested seeing in my search results content including of the posts and not just the title,date, categories and tags.

    Thank you

    #148736
    Tom
    Lead Developer
    Lead Developer

    Hi Chris,

    Give this function a try:

    add_filter( 'generate_show_excerpt','generate_full_post_search' );
    function generate_full_post_search( $show_excerpt )
    {
        if ( is_search() )
    		return false;
    	
    	return $show_excerpt;
    }

    Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

    #149094
    Chris

    Great, works 🙂

    Thank you a lot. Amazing support.

    #149098
    Tom
    Lead Developer
    Lead Developer
    #211208
    Markus

    Tom,

    great!

    This function works fine for me, too.

    Thank you

    #211264
    Tom
    Lead Developer
    Lead Developer
    #218386
    CatPerson

    Any progress on permitting full posts with active html on search result pages? I wasn’t able to try the content-search.php file you provided, alas. I have no experience with child themes. I tried a couple of plugins that claimed to create a child theme easily, but found them to be unfriendly and confusing. I can manage custom css, but I’m guessing this is a php thing.

    #218459
    Tom
    Lead Developer
    Lead Developer
Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.