Scriptrunner (Doug Sparling)
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to make page visible in the menu only if staying at that page?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
In reply to: Secure a page?You could try Exclude Pages to remove the page title from the menu and 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
In reply to: RSS error: Extra content at the end of the documentJust for the heck of it, look in
wp-includes/template-loader.phpand 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
In reply to: RSS error: Extra content at the end of the documentNo 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 WordPressBut 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
In reply to: What's the best way to redirect a single page for mobile devices?Something like this (but replace your page id with the one you want to redirect on). And this would be with PHP Browser Detection plugin.
if ( is_mobile() && 2 == get_the_ID() ) { // redirect }This could probably go anywhere after
get_header()inpage.php.Caveat – untested
Forum: Fixing WordPress
In reply to: What's the best way to redirect a single page for mobile devices?One possibility would be to use the 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
In reply to: RSS error: Extra content at the end of the documentThe 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.phpYou 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.phpand 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.phpthough 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
In reply to: call to undefined function get_header() LOCALHOSTI’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
In reply to: How to make page visible in the menu only if staying at that page?Awesome, thanks for the update. And you’re quite welcome!
Forum: Fixing WordPress
In reply to: Is there anyway to moderate use of shortcodes in wordpress?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
In reply to: call to undefined function get_header() LOCALHOSTNormally 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
In reply to: database problemYou most likely either have the wrong username or password (or both) for the new database.
Forum: Fixing WordPress
In reply to: Duplicate category pagesThanks for the update. Good to know!
Forum: Fixing WordPress
In reply to: How to make page visible in the menu only if staying at that page?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
In reply to: How to make page visible in the menu only if staying at that page?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 🙂