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?I’ll see if I can clean that up eventually 🙂
Forum: Fixing WordPress
In reply to: How to make page visible in the menu only if staying at that page?if ( (!is_home() && !is_single() && !is_category() && !is_tag() && !is_archive() ) )Forum: Fixing WordPress
In reply to: How to make page visible in the menu only if staying at that page?One more time! 🙂
Just changing the
ifstatement 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
In reply to: How to make page visible in the menu only if staying at that page?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
In reply to: Making posts page private?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
In reply to: Making posts page private?You might try the plugin route. I’ll be looking at that later today.
Forum: Fixing WordPress
In reply to: Making posts page private?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
In reply to: Making posts page private?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…Did you edit the css used by header.php or header.php itself?
Forum: Fixing WordPress
In reply to: Making posts page private?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
In reply to: MobileI 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 for some of the mobile-friendly plugins for WordPress.
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.
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
In reply to: Registration/Password Emails not being sentAs 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+tagCan 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…