Remove Page Timestamp via functions.php so it doesn’t show in Google Search Result Description [closed]

It depends on what the template uses to output whatever you’re trying to remove. If you look in source at whatever function is outputting what you want to remove, they each have a filter to let you modify output where you can __return_false instead, however, if there’s text or markup surrounding those template tags, your … Read more

adding more text to a query string

You can try and use set_query_var() very very early, before the query is parsed and queried for, for example during the pre_get_posts action. Although thinking about it, if you’re using pre_get_posts it’s likely easier to do something like this (off the top of my head): add_action( ‘pre_get_posts’, function( $query ) { if ( ! $query->is_main_query() … Read more

How to detect if the referer is 404 page?

Easiest and most robust way is to add a url parameter to the search so the search url will be something like http://www.example.com/?s=xyz&from404=1. Probably easiest way to do that is by adding a hidden field to the form. For “bonus points” use the browser’s history API to remove the parameter after the page load.

How can I add search box in single.php?

Try this and change the classes if needed. <div id=”navbar” class=”navbar”> <nav id=”site-navigation” class=”navigation main-navigation” role=”navigation”> <button class=”menu-toggle”><?php _e( ‘Menu’, ‘twentythirteen’ ); ?></button> <a class=”screen-reader-text skip-link” href=”#content” title=”<?php esc_attr_e( ‘Skip to content’, ‘twentythirteen’ ); ?>”><?php _e( ‘Skip to content’, ‘twentythirteen’ ); ?></a> <?php wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘menu_class’ => ‘nav-menu’, ‘menu_id’ => ‘primary-menu’ ) … Read more

How to have multiple instances of the same taxonomy in a search form

jpd527, Please remember that ‘tag’ is singular and not plural. Here your form has multiple HTML element with same id so this is wrong. Now if you require to search data with two different inputs, then you can merge it via JS. HTML code like: <form method=”get” id=”search form” action=”https://wordpress.stackexchange.com/”> <div> <input type=”text” value=”” name=”tag_one” … Read more

Make archive page show up in search results?

The issue is that an archive isn’t a post, it’s not something that can be shown in the loop. On your search results page, you’ll have to add some code to search categories for a similar name. You can accomplish this with the generic get_terms. Pass the searched term as the name__like argument (or maybe … Read more

Display Search Results after search 1st link

Redirecting to the first result of a search is a very unfriendly thing to do to your visitors and can quite possibly prevent them from ever finding the content they need, but it is very easy to do: function redir_first_wpse_49208() { if (is_search()) { global $wp_query; if (!empty($wp_query->posts)) { wp_redirect( get_permalink( $wp_query->posts[‘0’]->ID ) ); exit; … Read more

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