Sidebar current menu item for parent

I believe that it will be hard for you to accomplish that without some javascript because you are adding the link manually. However, you can achieve the same thing in another way: Most wordpress themes come with a body_class() function in the <body> tag. That function adds several classes to the body tag that allows … Read more

Rename Index.php

Just move your wordpress installation to a subdirectory and switch back after. See the WordPress Documentation.

Execute php in pages

If you have a page, and need to run PHP code that isn’t in your standard page template, you can: Use a custom page template Create a template with page-pagename.php Implement and use a shortcode All three are valid and suitable methods for doing this, however, do not: Try to let users place actual PHP … Read more

“Where… like” query not working as expected

You should definitely be using prepare in this case, as your query is accepting input. It would be quite trivial for someone to compromise your database otherwise. Here we also use the new-in-4.0 esc_like method: $like=”%” . $mydb->esc_like( $facility_name ) . ‘%’; $results = $mydb->get_results( $mydb->prepare( “SELECT facility_name FROM facility WHERE facility_name LIKE %s LIMIT … Read more