Remove from

try this add_filter( ‘the_content’, ‘remove_paragraphs_inside_blockquotes’, 9 ); function remove_paragraphs_inside_blockquotes( $content ) { $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML(‘<?xml encoding=”utf-8″ ?>’ . $content, LIBXML_HTML_NODEFDTD | LIBXML_HTML_NOIMPLIED); libxml_clear_errors(); $blockquotes = $dom->getElementsByTagName(‘blockquote’); foreach ( $blockquotes as $blockquote ) { foreach ( $blockquote->childNodes as $child ) { if ( $child->nodeName === ‘p’ ) { while ( $child->firstChild ) { … Read more

Add text/link next to the last word of each post

If your site or post type doesn’t use Gutenberg, this is likely because of the wpautop function: it is applied with priority 10 on the_content filter, so the paragraph tags have already been added by the time your filter is running. Changing your callback’s priority to be less than 10 will likely solve your issue. … Read more

How to display breadcrumb on category?

If you’re dealing with the default “Category” taxonomy and the post post type, then you can get the post’s attached category terms with get_the_category(). $categories = has_category( $post ) ? get_the_category( $post ) : array(); The has_category() check is there just to fend off other post type posts. get_the_category() gives you an array of categories … Read more