Forums

[resolved] How to display post content without Blockquote (9 posts)

  1. PuNK
    Member
    Posted 6 months ago #

    Hi.. All

    I use the_content on category pages to show post content & it shows Full post content I dnt wanna use the_excerpt bcoz it removes all formatings of content.

    Problem is when I use post_content it shows full content on category page. There is some portion in my posts in < blockquote > Tag. I want to hide this blockquote from the_content on category pages and to show this only on single post.

    Which function I should use to hide < blockquote > portion from appearing on category page?

  2. SwansonPhotos
    Member
    Posted 6 months ago #

    This previous post discusses this, how HTML tags are stripped in excerpts and has some usable recommendations and workarounds for this issue

  3. PuNK
    Member
    Posted 6 months ago #

    oh thanks a lot

    not so expert in php so its hard to understand & implement the code
    M checking that topic

  4. PuNK
    Member
    Posted 6 months ago #

    this Function related with Excerpt
    I want Full Content of Post but excluding < blockquote > text from IT

    I want to modify the_content with some function that I can put in category template like the_content_modify so that it shows all content from post excluding < blockquote > only from it.

    on Single Post the original the_content so to show full post content including blockquote.

  5. SwansonPhotos
    Member
    Posted 6 months ago #

    Try:

    echo strip_tags(get_the_content(), '<blockquote>');

  6. alchymyth
    The Sweeper
    Posted 6 months ago #

    does your theme use body_class() ? http://codex.wordpress.org/Function_Reference/body_class

    if so, you could use css to hide the blockquotes;

    example:
    body.category blockquote { display: none; }

  7. PuNK
    Member
    Posted 6 months ago #

    Thanks SwansonPhotos : Let me try that code

    nope dnt have that class but I like to add and check if that work
    thanks @alchymyth

  8. PuNK
    Member
    Posted 6 months ago #

    @SwansonPhotos: it Works but result is opposite

    I want all other tags there in content
    & want to remove blockquote along with content between blockquotes

  9. PuNK
    Member
    Posted 6 months ago #

    Oh I Got IT nw
    used preg_replace function instead of strip

    Thanks @SwansonPhotos for rite directions :))

Reply

You must log in to post.

About this Topic