Removing calls to noindex() and wp_no_robots()

Why you are changing the code for these thing which are able done via dashboard.? WordPress comes with a built-in feature that allows you to instruct search engines not to index your site. All you need to do is visit Settings » Reading and check the box next to Search Engine Visibility option. When this … Read more

Custom Content Page

I just can think two ways by now: 1) install another WordPress with other theme and create link to that 2) build these pages coding by yourself, php, HTML, CSS and Javascript There is a third way, using functions of the wp core, like developing a plugin, but I’m still trying to develop one and … Read more

Conditional string comparison failing for basename/slug

The 2nd part of the condition seems wrong basename( get_permalink() != ‘sponsor-one’) should be basename( get_permalink() ) != ‘sponsor-one’ Please check where the parenthesis ends. Also in your code if that is the only condition, then you can have an else statement instead of having another elseif.

How to add search to menu?

Use the get_search_form filter: add_filter(‘wp_nav_menu_items’,’add_search_box_to_menu’, 10, 2); function add_search_box_to_menu( $items, $args ) { if( $args->theme_location == ‘primary’ ) return $items. get_search_form(); return $items; } add_filter( ‘get_search_form’, ‘custom_search_form’ ); function custom_search_form( $form ) { ob_start(); // get_stylesheet_directory will get // the main directory of the child theme include( get_stylesheet_directory() . ‘/searchform.php’ ); $form = ob_get_clean(); return … Read more

Sending email for the custom form in WordPress

The easy way would install this plugin – https://da.wordpress.org/plugins/contact-form-7/ – It’s super easy to work with, and it will do what you want 🙂 If you don’t want to use a plugin, then you would just code a contact form with html and php. PHP: <?php $firstname = $_POST[‘firstname’]; $lastname = $_POST[‘lastname’]; $from = $_POST[’email’]; … Read more