Title: Scriptrunner (Doug Sparling)'s Replies - page 24 | WordPress.org

---

# Scriptrunner (Doug Sparling)

  [  ](https://wordpress.org/support/users/scriptrunner/)

 *   [Profile](https://wordpress.org/support/users/scriptrunner/)
 *   [Topics Started](https://wordpress.org/support/users/scriptrunner/topics/)
 *   [Replies Created](https://wordpress.org/support/users/scriptrunner/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/scriptrunner/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/scriptrunner/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/scriptrunner/engagements/)
 *   [Favorites](https://wordpress.org/support/users/scriptrunner/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 346 through 360 (of 520 total)

[←](https://wordpress.org/support/users/scriptrunner/replies/page/23/?output_format=md)
[1](https://wordpress.org/support/users/scriptrunner/replies/?output_format=md) 
[2](https://wordpress.org/support/users/scriptrunner/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/scriptrunner/replies/page/3/?output_format=md)…
[23](https://wordpress.org/support/users/scriptrunner/replies/page/23/?output_format=md)
24 [25](https://wordpress.org/support/users/scriptrunner/replies/page/25/?output_format=md)…
[33](https://wordpress.org/support/users/scriptrunner/replies/page/33/?output_format=md)
[34](https://wordpress.org/support/users/scriptrunner/replies/page/34/?output_format=md)
[35](https://wordpress.org/support/users/scriptrunner/replies/page/35/?output_format=md)
[→](https://wordpress.org/support/users/scriptrunner/replies/page/25/?output_format=md)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to make page visible in the menu only if staying at that page?](https://wordpress.org/support/topic/how-to-make-page-visible-in-the-menu-only-if-staying-at-that-page/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/how-to-make-page-visible-in-the-menu-only-if-staying-at-that-page/page/2/#post-4160027)
 * I’ll see if I can clean that up eventually 🙂
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to make page visible in the menu only if staying at that page?](https://wordpress.org/support/topic/how-to-make-page-visible-in-the-menu-only-if-staying-at-that-page/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/how-to-make-page-visible-in-the-menu-only-if-staying-at-that-page/page/2/#post-4160026)
 * `if ( (!is_home() && !is_single() && !is_category() && !is_tag() && !is_archive()))`
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to make page visible in the menu only if staying at that page?](https://wordpress.org/support/topic/how-to-make-page-visible-in-the-menu-only-if-staying-at-that-page/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/how-to-make-page-visible-in-the-menu-only-if-staying-at-that-page/page/2/#post-4160023)
 * One more time! 🙂
 * Just changing the `if` statement again:
 * `if ( (!is_home() && !is_single() && !is_category() && !is_tag() ) )`
 * Full code:
 *     ```
       add_filter( 'get_pages','include_current_page_if_hidden', 1000 );
       function include_current_page_if_hidden( $pages ) {
           if ( (!is_home() && !is_single() && !is_category() && !is_tag() ) )
               return $pages;
   
           $postspage_id = get_option('page_for_posts');
           for ( $i = 0; $i < count( $pages ); $i++ ) {
               $included_ids[] = $pages[$i]->ID;
           }
   
           if ( !in_array( $postspage_id, $included_ids ) ) {
               $pages[] = get_post( $postspage_id );
           }
   
           return $pages;
       }
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to make page visible in the menu only if staying at that page?](https://wordpress.org/support/topic/how-to-make-page-visible-in-the-menu-only-if-staying-at-that-page/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/how-to-make-page-visible-in-the-menu-only-if-staying-at-that-page/page/2/#post-4160021)
 * OK, I’ll look at it over the weekend. Shouldn’t take too much to fix. I just 
   need to be sitting in front of my computer so I can test it first 🙂
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Making posts page private?](https://wordpress.org/support/topic/making-posts-page-private-1/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/making-posts-page-private-1/#post-4168309)
 * This works for me (but this is just something I threw together, so if it doesn’t
   do what you want, let me know).
 * Add to functions.php of your theme:
 *     ```
       function make_posts_page_private() {
           if ( is_home() && !is_user_logged_in() )
           exit( wp_redirect( home_url( '/' ) ) );
       }
       add_action( 'template_redirect', 'make_posts_page_private' );
       ```
   
 * Though you may want to change where the redirect takes the non-logged in user.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Making posts page private?](https://wordpress.org/support/topic/making-posts-page-private-1/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/making-posts-page-private-1/#post-4168282)
 * You might try the plugin route. I’ll be looking at that later today.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Making posts page private?](https://wordpress.org/support/topic/making-posts-page-private-1/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/making-posts-page-private-1/#post-4168273)
 * I just discovered this recently, but you can’t use a private page for blog posts.
   If you use a different page for posts and then set that page to private, you 
   can tell from Settings->Reading that WordPress no longer uses that page (I’m 
   guessing it’s using a default like it does when posts are on your front page).
 * This is something I need to know, so if you don’t find out from someone else,
   I’ll be digging into it.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Making posts page private?](https://wordpress.org/support/topic/making-posts-page-private-1/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/making-posts-page-private-1/#post-4168246)
 * There used to be a Site Visibility setting under `Settings->Privacy` (pre-WordPress
   3.5) and later moved to Settings->Reading, but I’m not seeing it in WordPress
   3.6.1…
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Warning: call_user_func_array() expects parameter 1 to be a valid callback…](https://wordpress.org/support/topic/warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback-1/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback-1/#post-4168245)
 * Did you edit the css used by header.php or header.php itself?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Making posts page private?](https://wordpress.org/support/topic/making-posts-page-private-1/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/making-posts-page-private-1/#post-4168234)
 * When you use a static page as your front page and set another page for your posts,
   it works a little differently. If you set the posts page to private, it will 
   remove the title from the menu, but the page itself is still visible if you go
   to the link directly (unlike other pages where it will return a 404). As is, 
   you need to set all your posts to private as well.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Mobile](https://wordpress.org/support/topic/mobile-14/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/mobile-14/#post-4168230)
 * I agree with Andrew, you’ll need to contact Elegant Themes and see if they’ll
   support mobile. I don’t see anything about this theme being mobile friendly on
   their site.
 * In the mean time, you might [search](http://wordpress.org/plugins/tags/mobile-plugin)
   for some of the mobile-friendly plugins for WordPress.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Warning: call_user_func_array() expects parameter 1 to be a valid callback…](https://wordpress.org/support/topic/warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback-1/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback-1/#post-4168216)
 * You probably need to restore your theme if possible.
 * It’s also possible there is a theme/plugin conflict, so disabling all your plugins
   would determine that (you can just temporarily rename your plugin directory).
 * However as you said the problem occurred after modifying header.php in your theme,
   I’d venture to guess that’s where the problem lies. If you could post the original
   snippet from your header.php file and the code you replaced it with, that would
   be a help as well.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Warning: call_user_func_array() expects parameter 1 to be a valid callback…](https://wordpress.org/support/topic/warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback-1/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback-1/#post-4168209)
 * Place your code on the forum between backticks (`) so it’ll format properly. 
   The line break is probably just the browser interpreting the tag instead of displaying
   it.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Registration/Password Emails not being sent](https://wordpress.org/support/topic/registrationpassword-emails-not-being-sent/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/registrationpassword-emails-not-being-sent/#post-4005808)
 * As an aside, not including a closing php tag (`?>`) at the end of a file is considered
   a best practice and is not an error. Primarily because inadvertent white space
   after the closing tag can cause problems. [https://www.google.com/search?q=php+best+pracitce+closing+tag](https://www.google.com/search?q=php+best+pracitce+closing+tag)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Warning: call_user_func_array() expects parameter 1 to be a valid callback…](https://wordpress.org/support/topic/warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback-1/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback-1/#post-4168201)
 * Can you replace header.php with a fresh copy?
 * Please post the relevant code from header.php as that’s what’s causing the problem.
   The core file is throwing an error because what’s passed to it (presumably from
   header.php) is invalid.
 * I usually find it best not to edit files from the WP editor as it’s too easy 
   to break my theme…

Viewing 15 replies - 346 through 360 (of 520 total)

[←](https://wordpress.org/support/users/scriptrunner/replies/page/23/?output_format=md)
[1](https://wordpress.org/support/users/scriptrunner/replies/?output_format=md) 
[2](https://wordpress.org/support/users/scriptrunner/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/scriptrunner/replies/page/3/?output_format=md)…
[23](https://wordpress.org/support/users/scriptrunner/replies/page/23/?output_format=md)
24 [25](https://wordpress.org/support/users/scriptrunner/replies/page/25/?output_format=md)…
[33](https://wordpress.org/support/users/scriptrunner/replies/page/33/?output_format=md)
[34](https://wordpress.org/support/users/scriptrunner/replies/page/34/?output_format=md)
[35](https://wordpress.org/support/users/scriptrunner/replies/page/35/?output_format=md)
[→](https://wordpress.org/support/users/scriptrunner/replies/page/25/?output_format=md)