Scriptrunner (Doug Sparling)
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: URL Redirect / .htaccess / subdomain / maintenance page madnessIf you just want to redirect any path/url for newsite.com to the home page of oldsite.com, then just use this simple redirect in .htaccess on newsite.com web root directory.
Redirect 302 / http://www.oldsite.com/Use a 302 instead of a 301 as you don’t want this redirect to be considered permanent.
Forum: Fixing WordPress
In reply to: Brute force attack solution via .htpasswd?Are you saying that you are adding an Apache basic authentication on your login page (using htpasswd) so you have to get past that before you can log into WordPress? If so, once you’ve authenticated successfully via basic auth, then it stays active until you close your browser.
Another option would be to use a Limit Login attemps plugin (there are several) or WP Better Security, which also limits the amount of times a user can attempt to login. However, there’s nothing wrong with putting basic authentication in front of your admin page.
What you’ve done is actually one of the suggestions in the Codex page on brute force attacks (but there’s other good info there too):
Forum: Fixing WordPress
In reply to: wp_list_pages() and throwing PHP warningsI don’t – it works fine for me using default WordPress Twenty Thirteen theme.
Could you post the errors? It’s quite possibly your theme or a plugin. (try disabling all plugins and switching to a default WordPress theme to verify)
Forum: Fixing WordPress
In reply to: Some external links on pages not workingYou’re using a frameset for some reason, that seems to be breaking links.
If I navigate to “Links and Resources,” links aren’t working, but if I got straight to the page in the frameset:
http://alaskaseafoodcooperative.org/WP/links-and-resources-2/
Don’t use frames.
If you don’t want your main url:
http://alaskaseafoodcooperative.org/WP
to contain the “WP,” then there are better was to do that.
Forum: Fixing WordPress
In reply to: where does get_term_link() go to?If no one else responds first, I’ll try and take a look when I have some time…
Forum: Fixing WordPress
In reply to: Posts Page IDTo find the page that contains the posts (the listing of posts), you use:
get_option('page_for_posts')as alchymyth said.
$posts_page_id = get_option( 'page_for_posts' ); echo "posts page id: " . $posts_page_id;The caveat is that this value will only be set if you assign a static page for your front page and assign another page for your posts page (via Settings->Reading). When you run WordPress where the front page displays your blogs posts, that’s a special case and there is no “posts page” id. (actually, I think it comes back as 0).
Forum: Fixing WordPress
In reply to: Cannot redeclare has_shortcode WP 3.6.1You just need to rename
has_shortcodein functions.php to something unique (as of WordPress 3.6, it includes a function of the same name). Then you need to update the add_action or whatever is calling your function to use the same, updated name.Forum: Fixing WordPress
In reply to: Illegal string offset 'sidebar' error on some pagesThat’s actually a warning, not an error, so it won’t cause a runtime error.
Error: Fatal run-time errors. These indicate errors that can not be recovered from, such as a memory allocation problem. Execution of the script is halted.
Warning: Run-time warnings (non-fatal errors). Execution of the script is not halted.
This also tells me you’re running your WordPress site with debug mode on, which is not a good practice.
In wp-config.php, change:
define('WP_DEBUG', true);to:
define('WP_DEBUG', false);As far as the warning message itself:
Warning: Illegal string offset 'sidebar'This generally means that your code is trying to access a key in an array that doesn’t exist. The theme author needs to fix that by checking that a key in the array exists (is_set) before trying to access it.
It does indicate a problem with the code, but not a fatal one. I often see piles of Warning messages from various plugins when I turn on DEBUG. (which doesn’t make it right, but sadly it isn’t uncommon) At the very least, set DEBUG to false so the Warnings won’t display on your production site.
Forum: Fixing WordPress
In reply to: Embedding and Uploading a .SWF FileI have clients who still need to upload swf files (but only their admin user). I’d never allow an upload of an exe file, though, which was also disabled in WordPress 3.6.1.
If it’s only you (the admin) and you’re aware of the potential risks here’s how to allow swf uploads:
Forum: Fixing WordPress
In reply to: Can't upload swf files to wordpress anymore.chrisntoukas, you’re quite welcome! If you don’t mind, please mark the topic as resolved to help others who may have run across the same incorrect code in the other post.
Forum: Fixing WordPress
In reply to: Proper Category and Tag base 301 redirectionIf I understand your question correctly (you want to redirect a “subcategory”), then just modify that redirect and place it after the category->newcat redirect you alrady added:
Redirect 301 /newcat/books/ http://www.example.com/newcat/articles/Forum: Fixing WordPress
In reply to: Exclude Single Post View of Certain CategoriesAdd this to your themes functions.php and see if it works for you. It might need a little tweaking, just let me know:
function exclude_category( $query ) { // Add your category id(s) here $excluded_category_ids = array(1,17); if ( $query->is_main_query() ) { if ( ( $query->is_home() || $query->is_category() || $query->is_archive() || $query->is_feed() ) || ( !is_admin() && $query->is_search() ) ) { $query->set('category__not_in', $excluded_category_ids); } elseif ( $query->is_single() ) { $post_categories = wp_get_post_categories( $query->query_vars['p'] ); foreach ($excluded_category_ids as $category_id ) { if ( in_array( $category_id, $post_categories ) ) { $query->set( 'p', -$category_id ); break; } } } } } add_action( 'pre_get_posts', 'exclude_category' );Just change:
$excluded_category_ids = array(1,17);to include whatever category ids you want to exclude. Must be an array (but it can contain just one element).
Forum: Fixing WordPress
In reply to: Exclude Single Post View of Certain CategoriesOK, cool. I’ll take a look and see what I can come up with (as I have time).
Forum: Fixing WordPress
In reply to: Exclude Single Post View of Certain CategoriesSo basically you don’t want the post to be visible in any view that would normally show it? (single, category, tag, archive, etc) What do your custom made elements rely on, if anything, to display these particular posts? (category?) I assume it’s different from making the posts private? Is there any particular plugin that comes closest to what you want?
Forum: Fixing WordPress
In reply to: where does get_term_link() go to?Without sample code, it’s hard to say. Did you check out the Codex example?