WordPress Search

Your search form includes this: <input type=”hidden” name=”post_type” value=”postpage” /> So when your search page loads, the query variable ‘post_type’ is set to load posts of type ‘postpage’. Since posts are of type ‘post’ and pages are of type ‘page’, neither of which are ‘postpage’, you do not get what you expected. Next time, don’t … Read more

Removed jQuery script from header.php , any problems?

Here is the correct way to include jQuery in your theme. Open functions.php in your theme folder and add this to it: // Proper way to enqueue scripts and styles function royal_insert_jquery(){ wp_enqueue_script(‘jquery’, false, array(), false, false); } add_filter(‘wp_enqueue_scripts’,’royal_insert_jquery’,1); This will load the WordPress bundled version of jQuery and will make sure that it is … Read more

Make a page (url) not cacheable [closed]

This has nothing to do with caching, but with form auto-completion. It is happening because the browser is set to store form content. To avoid this, you should generate a random code and add it to the name attribute of your input tags. Then send the random generated number trough another hidden input so you … Read more

Change Spaces to Dashes?

You could simply use str_replace: str_replace( ‘ ‘, ‘-‘, $name ) In your code, this would translate to: return ‘<img src=”https://wordpress.stackexchange.com/images/flags/” . str_replace( ‘ ‘, ‘-‘, $name ) . ‘.gif” alt=”‘ . $name .'” title=”‘ . $name . ‘” class=”flag tooltip” />’;

How to redirect to a page after the form is submitted

You can remove the else statement so that user will see the message and will be able to upload csv again or you can redirect using echo ‘<script>windows.location.href=”‘ . $url . ‘”</script>’; die; Edit $admin_services = add_menu_page( ‘Fee Schedule’, ‘Fee Schedule’, ‘administrator’, ‘pd- services’, ‘pd_services’ ); function pd_services() { ?> <div class=”wrap”> <form name=”csvupload” action=”” … Read more

The user can only see their own profile

Inside your template you can implement a condition checking if the user is a super admin or if the user has certain capabilities (if you want to target administrators and not only super admins) First case if (is_super_admin() ) { //your super admin logic here }else{ //subscriber logic } Second case if ( current_user_can( ‘manage_options’ … Read more

wpdb getting avatars and author url

You just need to return the user ID in the main select and use that as the author ID. Also I probably confused the issue previously by using echo with commas (separate arguments) rather than dots (one concatenated argument). $weekly = $wpdb->get_results ( ” SELECT u.ID, ( SELECT CONCAT_WS(‘.’, SUM(CASE WHEN p.post_date > ‘$date2’ THEN … Read more