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?
This previous post discusses this, how HTML tags are stripped in excerpts and has some usable recommendations and workarounds for this issue
oh thanks a lot
not so expert in php so its hard to understand & implement the code
M checking that topic
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.
Try:
echo strip_tags(get_the_content(), '<blockquote>');
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; }
Thanks SwansonPhotos : Let me try that code
nope dnt have that class but I like to add and check if that work
thanks @alchymyth
@SwansonPhotos: it Works but result is opposite
I want all other tags there in content
& want to remove blockquote along with content between blockquotes
Oh I Got IT nw
used preg_replace function instead of strip
Thanks @SwansonPhotos for rite directions :))