Title: Scriptrunner (Doug Sparling)'s Replies - page 25 | 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 - 361 through 375 (of 520 total)

[←](https://wordpress.org/support/users/scriptrunner/replies/page/24/?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)…
[24](https://wordpress.org/support/users/scriptrunner/replies/page/24/?output_format=md)
25 [26](https://wordpress.org/support/users/scriptrunner/replies/page/26/?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/26/?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-4160017)
 * No worries. I’ve tried not to hardcore anything so the solution will be generic
   enough for anyone else who may cone across this thread.
 * I’m not at my computer at the moment (posting from my phone), but looking at 
   the code I think you can change one line to fix it.
 * Change
 * `if ( (!is_home() && !is_single() ) )`
 * to
 * `if ( !is_home() )`
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Secure a page?](https://wordpress.org/support/topic/need-help-secure-a-page/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/need-help-secure-a-page/#post-4166813)
 * You could try [Exclude Pages](http://wordpress.org/plugins/exclude-pages/) to
   remove the page title from the menu and [Simply Exclude](http://wordpress.org/plugins/simply-exclude/)
   so the page can’t be found on a site search (via the WordPress search box on 
   your own site).
 * Not perfect, should do. Otherwise you’ll need to create dynamic links or require
   a user to log in.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [RSS error: Extra content at the end of the document](https://wordpress.org/support/topic/rss-error-extra-content-at-the-end-of-the-document/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/rss-error-extra-content-at-the-end-of-the-document/page/2/#post-4157803)
 * Just for the heck of it, look in
 * `wp-includes/template-loader.php`
 * and see if this bit of code is in there, particularly the return statement:
 *     ```
       elseif ( is_feed() ) :
           do_feed();
           return;
       ```
   
 * It almost acts like it’s continuing on down to the remaining template logic, 
   which would cause a page to be spit out after the feed.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [RSS error: Extra content at the end of the document](https://wordpress.org/support/topic/rss-error-extra-content-at-the-end-of-the-document/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/rss-error-extra-content-at-the-end-of-the-document/#post-4157802)
 * No damage, but keep in mind you’ve updated a core file, so:
 * 1) It didn’t fix the root cause of the problem
    2) You’ll have to repeat each
   time you upgrade WordPress
 * But at least you’re back in business and if you feel courageous, you can poke
   around. I really can’t tell much more from here 🙂
 * I’m just trying to think what would cause it to keep processing. I’ll follow 
   the trail a bit further…maybe not until tomorrow, though.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [What's the best way to redirect a single page for mobile devices?](https://wordpress.org/support/topic/whats-the-best-way-to-redirect-a-single-page-for-mobile-devices/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/whats-the-best-way-to-redirect-a-single-page-for-mobile-devices/#post-4155694)
 * Something like this (but replace your page id with the one you want to redirect
   on). And this would be with [PHP Browser Detection](http://wordpress.org/plugins/php-browser-detection/)
   plugin.
 *     ```
       if ( is_mobile() && 2 == get_the_ID() ) {
           // redirect
       }
       ```
   
 * This could probably go anywhere after `get_header()` in `page.php`.
 * Caveat – untested
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [What's the best way to redirect a single page for mobile devices?](https://wordpress.org/support/topic/whats-the-best-way-to-redirect-a-single-page-for-mobile-devices/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/whats-the-best-way-to-redirect-a-single-page-for-mobile-devices/#post-4155693)
 * One possibility would be to use the [PHP Browser Detection](http://wordpress.org/plugins/php-browser-detection/)
   and put an if statement in your header.php file.
 * Check for `is_mobile()` and the page id you want to redirect on. Shouldn’t be
   more than a plugin and a simple if/else statement.
 * Edit: You may need to put it in page.php. Not sure you can get to page id in 
   header.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [RSS error: Extra content at the end of the document](https://wordpress.org/support/topic/rss-error-extra-content-at-the-end-of-the-document/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/rss-error-extra-content-at-the-end-of-the-document/#post-4157799)
 * The error log may or may not be of help depending on what the issue is.
 * How comfortable are you editing files?
 * It looks like in a default configuration, your feed is coming from
 * `wp-includes/feed-rss2.php`
 * You might be able to edit that and see if you get any changes or where the extra
   html is coming from. One caveat, you’ll need to disable Magpie cache on the RSS
   feed, which is actually pretty easy.
 * To do that, open up (around line 645 in WordPress 3.6.1)
 * `wp-includes/rss.php`
 * and change
 *     ```
       if ( !defined('MAGPIE_CACHE_AGE') ) {
           define('MAGPIE_CACHE_AGE', 60*60); // one hour
       }
       ```
   
 * to
 *     ```
       if ( !defined('MAGPIE_CACHE_AGE') ) {
           //define('MAGPIE_CACHE_AGE', 60*60); // one hour
           define('MAGPIE_CACHE_AGE', 0);
       }
       ```
   
 * Then you should be able to edit `wp-includes/feed-rss2.php` though you may need
   to do a full refresh on your browser with each change.
 * This about all I can do with the info given. A bit of a mystery, I’ve never seen
   a full html page added to the end of an RSS feed before (only error messages).
   If it makes a difference, it looks like the latest post (Our Team) is what’s 
   being added.
 * A second caveat – I’m assuming it’s the rss2 (default) feed. Given the link you
   provided, it should be.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [call to undefined function get_header() LOCALHOST](https://wordpress.org/support/topic/call-to-undefined-function-get_header-localhost/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_header-localhost/#post-4165672)
 * I’m not quite sure what you’re trying to accomplish, then. You shouldn’t need
   to call a .php file directly in an href (though in theory you could). It should
   be a standard WordPress page. If you do indeed want to call a php file, it won’t
   have any idea what `get_header()` is without WordPress core being loaded.
 *   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-4160003)
 * Awesome, thanks for the update. And you’re quite welcome!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Is there anyway to moderate use of shortcodes in wordpress?](https://wordpress.org/support/topic/is-there-anyway-to-moderate-use-of-shortcodes-in-wordpress/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/is-there-anyway-to-moderate-use-of-shortcodes-in-wordpress/#post-4163350)
 * I’ll see if anyone has done this before via plugin or functions.php first. I’m
   just basing my answer on what I think could be done. I’d actually have to sit
   down and write some test code (which I do quite often for forum answers).
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [call to undefined function get_header() LOCALHOST](https://wordpress.org/support/topic/call-to-undefined-function-get_header-localhost/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_header-localhost/#post-4165662)
 * Normally the files in the your theme directory are templates, not files you call
   directly. You need to create a standard WordPress page and put the contents of
   guide.php in that (sans any PHP code).
 * Also, let us know that the error message is.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [database problem](https://wordpress.org/support/topic/database-problem-33/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/database-problem-33/#post-4166223)
 * You most likely either have the wrong username or password (or both) for the 
   new database.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Duplicate category pages](https://wordpress.org/support/topic/duplicate-category-pages/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/duplicate-category-pages/#post-4157794)
 * Thanks for the update. Good to know!
 *   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/#post-4159999)
 * Slightly different approach for your situation. This should work if you just 
   set the “blog” page to private. No need for the plugin. Add to `functions.php`.
 *     ```
       add_filter( 'get_pages','include_current_page_if_hidden', 1000 );
       function include_current_page_if_hidden( $pages ) {
           if ( (!is_home() && !is_single() ) )
               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/#post-4159993)
 * I can’t get to it right now (I’ll try to get to it later today), but yes, I think
   I can make it work with Excluded Pages plugin. Using a static page for the blog
   is kind of a special case and my earlier code won’t work. But I should be able
   to modify it so it will.
 * Now I know exactly what you’re trying to accomplish. Thanks for sticking with
   me 🙂

Viewing 15 replies - 361 through 375 (of 520 total)

[←](https://wordpress.org/support/users/scriptrunner/replies/page/24/?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)…
[24](https://wordpress.org/support/users/scriptrunner/replies/page/24/?output_format=md)
25 [26](https://wordpress.org/support/users/scriptrunner/replies/page/26/?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/26/?output_format=md)