{"id":330,"date":"2026-11-20T13:00:01","date_gmt":"2026-11-20T12:00:01","guid":{"rendered":"https:\/\/www.netlabor.it\/?p=330"},"modified":"2026-11-20T13:00:31","modified_gmt":"2026-11-20T12:00:31","slug":"il-bug-dellicona-di-ricerca-nel-tema-mcluhan-causato-da-bogo-e-come-ho-risolto","status":"publish","type":"post","link":"https:\/\/www.netlabor.it\/en\/il-bug-dellicona-di-ricerca-nel-tema-mcluhan-causato-da-bogo-e-come-ho-risolto\/","title":{"rendered":"The McLuhan Theme Search Icon Bug (caused by Bogo Plugin) \u2014 and How I Fixed It"},"content":{"rendered":"\n<div class=\"wp-block-bogo-language-switcher\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">The Problem<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you use the <strong>McLuhan<\/strong> WordPress theme on a site with the <strong>Bogo<\/strong> multilingual plugin active, you may have noticed that the search icon (magnifying glass) in the bottom-left footer <strong>doesn&#8217;t show up<\/strong> and instead a link icon appears. And if you click on it, instead of opening the search overlay, the site redirects you to <a href=\"https:\/\/www.netlabor.it\/?s\"><code>https:\/\/www.example.com\/?s<\/code><\/a> showing an empty search results page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Without Bogo, the theme works normally: the href stays <code>?s=<\/code> and the icon appears. The issue only arises when Bogo is active.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How I Found the Root Cause (Three Layers of the Same Bug)<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">The starting point: Bogo truncates the URL<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The code in <code>header.php<\/code> is correct:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;a href=\"&lt;?php echo home_url('?s='); ?&gt;\"&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On a normal site, this produces:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;a href=\"https:\/\/www.netlabor.it\/?s=\"&gt;&lt;\/a&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">But when the <strong>Bogo<\/strong> plugin is active, it rewrites URLs for language switching and in the process <strong>drops the <code>=<\/code><\/strong>, turning <code>?s=<\/code> into <code>?s<\/code>. The resulting HTML is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;a href=\"https:\/\/www.netlabor.it\/?s\"&gt;&lt;\/a&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is what triggers the bug.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. CSS side: the icon never renders<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In <code>style.css<\/code> at line 867, a CSS attribute selector is used to render the Font Awesome icon:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>a&#091;href*=\"?s=\"]::before {\n    content: \"\\f002\"; \/* magnifying glass *\/\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The selector <code>a[href*=\"?s=\"]<\/code> looks for an <code>href<\/code> containing the string <code>?s=<\/code>. But since Bogo changed the href to <code>?s<\/code> (no <code>=<\/code>), <strong>no element is matched<\/strong> and the icon never appears.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. JS side: the click handler never binds<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In <code>assets\/js\/global.js<\/code> at line 57:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$('a&#091;href$=\"?s=\"]').on('click', function(e) {\n    e.preventDefault();\n    \/\/ open search overlay\n});<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Again, <code>a[href$=\"?s=\"]<\/code> (ends-with) doesn&#8217;t match <code>?s<\/code>, so the click is never intercepted and the browser navigates normally to the empty search page.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why Bogo does this<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Bogo is a multilingual plugin that rewrites URLs to manage languages. When it passes the URL through its normalization logic, it strips the <code>=<\/code> from empty-valued parameters. This behavior is specific to Bogo \u2014 on other sites (without Bogo), the href stays <code>?s=<\/code> and everything works as expected.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The Fix: Create a Child Theme and Modify There<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The solution is simple: instead of matching <code>?s=<\/code> or <code>?s<\/code> separately, use a selector that matches <strong>both<\/strong> forms. Just change <code>=<\/code> to <code>*<\/code> (the &#8220;contains&#8221; selector).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Important<\/strong>: never modify files directly in the parent theme. Use a <strong>child theme<\/strong> for two reasons:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Parent theme updates won&#8217;t overwrite your changes<\/li>\n\n\n\n<li>JavaScript files from the parent theme are NOT automatically loaded by the child theme \u2014 you must dequeue and re-enqueue them<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Step 1: Create the child theme structure<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Create the folder <code>mcluhan-child\/<\/code> with these two files:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>mcluhan-child\/style.css<\/code><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/*\n Theme Name:   McLuhan Child\n Template:     mcluhan\n Description:  Child theme to fix the search icon bug with Bogo\n Version:      1.0\n*\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>mcluhan-child\/functions.php<\/code><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\n\/\/ Load the parent theme's stylesheet first\nadd_action('wp_enqueue_scripts', 'mcluhan_child_enqueue_parent_styles', 10);\nfunction mcluhan_child_enqueue_parent_styles() {\n    wp_enqueue_style('mcluhan-style', get_template_directory_uri() . '\/style.css');\n}\n\n\/\/ Then load the child theme's stylesheet\nadd_action('wp_enqueue_scripts', 'mcluhan_child_enqueue_child_styles', 20);\nfunction mcluhan_child_enqueue_child_styles() {\n    wp_enqueue_style('mcluhan-child-style', get_stylesheet_directory_uri() . '\/style.css');\n}\n\n\/\/ CRITICAL: dequeue the parent's JS and re-enqueue from the child theme\n\/\/ Otherwise the buggy parent version keeps loading\nadd_action('wp_enqueue_scripts', 'mcluhan_child_enqueue_scripts', 30);\nfunction mcluhan_child_enqueue_scripts() {\n    wp_dequeue_script('mcluhan_global');\n    wp_enqueue_script(\n        'mcluhan_global',\n        get_stylesheet_directory_uri() . '\/assets\/js\/global.js',\n        array('jquery'),\n        '1.0.1', \/\/ corrected version\n        true\n    );\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 2: Copy and modify <code>assets\/js\/global.js<\/code><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Copy <code>assets\/js\/global.js<\/code> from the parent theme into <code>mcluhan-child\/assets\/js\/global.js<\/code> and change these two lines:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Line 57 \u2014 main click handler<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ BEFORE:\n$('a&#091;href$=\"?s=\"]').on('click', function(e) {\n    e.preventDefault();\n    \/\/ open search overlay\n});\n\n\/\/ AFTER:\n$('a&#091;href*=\"?s\"]').on('click', function(e) {\n    e.preventDefault();\n    \/\/ open search overlay\n});<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Line 73 \u2014 alternate handler<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ BEFORE:\n$('a&#091;href$=\"?s=\"]').on('click', function(e) {\n    e.preventDefault();\n    \/\/ other action\n});\n\n\/\/ AFTER:\n$('a&#091;href*=\"?s\"]').on('click', function(e) {\n    e.preventDefault();\n    \/\/ other action\n});<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 3: Copy and modify <code>style.css<\/code><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Copy <code>style.css<\/code> from the parent theme into <code>mcluhan-child\/style.css<\/code> (overwriting the one from step 1) and change line 867:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/* BEFORE: *\/\na&#091;href*=\"?s=\"]::before {\n    content: \"\\f002\";\n    \/* ... icon styles *\/\n}\n\n\/* AFTER: *\/\na&#091;href*=\"?s\"]::before {\n    content: \"\\f002\";\n    \/* ... icon styles *\/\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 4: Activate the child theme<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In the WordPress admin, go to Appearance \u2192 Themes and activate <strong>McLuhan Child<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Summary of Changes<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>File<\/th><th>Change<\/th><\/tr><\/thead><tbody><tr><td><code>mcluhan-child\/functions.php<\/code><\/td><td>Dequeue and re-enqueue JS from child theme<\/td><\/tr><tr><td><code>mcluhan-child\/assets\/js\/global.js<\/code> (line 57)<\/td><td><code>a[href$=\"?s=\"]<\/code> \u2192 <code>a[href*=\"?s\"]<\/code><\/td><\/tr><tr><td><code>mcluhan-child\/assets\/js\/global.js<\/code> (line 73)<\/td><td><code>a[href$=\"?s=\"]<\/code> \u2192 <code>a[href*=\"?s\"]<\/code><\/td><\/tr><tr><td><code>mcluhan-child\/style.css<\/code> (line 867)<\/td><td><code>a[href*=\"?s=\"]::before<\/code> \u2192 <code>a[href*=\"?s\"]::before<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><code>[href*=\"?s\"]<\/code> means &#8220;whose href contains <code>?s<\/code>&#8220;. This matches both <code>?s<\/code> and <code>?s=<\/code>, making the theme robust regardless of how Bogo (or any other plugin) formats the URL.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why This Article Matters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This bug is a great example of how a seemingly minor issue (a missing character in a URL) can manifest in three different layers (PHP \u2192 CSS \u2192 JS) and be amplified by a third-party plugin. The fix takes seconds, but without knowing where to look, it can feel like a mystery.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you found this on your own site, I hope these lines save you some time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Problem If you use the McLuhan WordPress theme on a site with the Bogo multilingual plugin active, you may have noticed that the search icon (magnifying glass) in the bottom-left footer doesn&#8217;t show up and instead a link icon appears. And if you click on it, instead of opening the search overlay, the site [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"full-width-page-template.php","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/www.netlabor.it\/?p=327","footnotes":""},"categories":[6,12],"tags":[8,13],"class_list":["post-330","post","type-post","status-publish","format-standard","hentry","category-informatica","category-wordpress","tag-informatica","tag-wordpress","en-US","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/posts\/330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/comments?post=330"}],"version-history":[{"count":2,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/posts\/330\/revisions"}],"predecessor-version":[{"id":332,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/posts\/330\/revisions\/332"}],"wp:attachment":[{"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/media?parent=330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/categories?post=330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/tags?post=330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}