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

How to add ‘nofollow’ flag to all Tag archive hyperlinks?

I already had this challenge before and here is my personal solution for you: 1. For the tag cloud widget you can use this approach: add_filter(‘wp_tag_cloud’, ‘add_nofollow_to_tag_cloud’); function add_nofollow_to_tag_cloud($content) { // Add ‘nofollow’ to the links $content = str_replace(‘<a href=”‘, ‘<a rel=”nofollow” href=”‘, $content); return $content; } I already tested this locally and it works … Read more

Search only by post_tags

search behaviour in wp to only search by post tags and not return results for titles or content if the tag is not found. You can achieve this by customizing the search query using functions.php function custom_search_filter($query) { // Check if it’s the main query and it’s a search query if ($query->is_main_query() && $query->is_search()) { … Read more

How to Display Posts on a Tag Archive Page Based on Custom Field(term meta) Values in WordPress?

Use this- function custom_tag_archive_query( $query ) { if ( is_tag() && $query->is_main_query() && !is_admin() ) { $tag = get_queried_object(); $tag_name = $tag->name; $similar_names = get_term_meta( $tag->term_id, ‘similar_names’, true ); $similar_names_array = explode( ‘,’, $similar_names ); $similar_names_array = array_map( ‘trim’, $similar_names_array ); $similar_names_array[] = $tag_name; // include the tag name itself in the search terms $meta_query … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)