Doug Vanderweide
Forum Replies Created
-
Regarding the “Featured Image”, if you mean you can’t see the box to add a featured image to your post, in the Dashboard, when editing a post, click “Screen Options” in the upper-right-hand corner and make sure “Featured Images” is checked.
Forum: Fixing WordPress
In reply to: Photo when sharing postAngela: Make sure each of your posts has a <a href=”
https://codex.ww.wp.xz.cn/Post_Thumbnails”>featured image / post thumbnail. That’s the picture that appears to be used when your posts are bookmarked.Forum: Fixing WordPress
In reply to: Image uploaded but not added to libraryI believe the problem is related to WordPress attempting to make its thumbnail, medium and large version copies of your images. In short, the photo is uploaded just fine, but when WordPress attempts to resize it, it’s either trying to get the image from the wrong place, or it’s not able to save the resized images to the right place.
In theory this shouldn’t be an issue because the image directory is actually in a subdirectory of your website’s home directory, but it may be that your host’s settings effectively treat that directory as not being part of your main web site’s physical file paths because you applied a subdomain to it.
In other words, it looks to you like it’s a subdirectory, but certain settings in the hosting environment tell PHP / WordPress that the directory does not exist as a subdirectory of your main site.
Unfortunately there is no easy way to resolve this. I would say to contact your hosting company but my guess is that this is not something the average front-line tech can even understand, nonetheless address. You’d need some fairly advanced tech support to get this sorted out.
Meanwhile, your best fix is to go back to not having a subdirectory. I know that’s not cool, but clearly you have a configuration issue.
Forum: Hacks
In reply to: wp_handle_upload () setting $overrides correctlyRe: how to set the handler’s action to the form’s action, in the form pageelf I would set a variable like
$myaction = htmlspecialchars( $_SERVER['PHP_SELF'] );and then pass in
$upload_overrides = array( 'action' => $myaction, 'test_form' => false, 'mimes' => array('jpg' => 'image/jpeg', 'png' => 'image/png') );Re: Does setting test to false just override security, the short answer is yes.
Forum: Fixing WordPress
In reply to: WARNING: Cannot modify header information – headers already sentThis is something of a stab, but the error you are getting is generated when WordPress is trying to set the cookie that identifies you as a user and saves certain settings on your computer.
First, try clearing your web browser’s cookies and cache. It may be that an old setting from a disabled plugin is causing this problem.
If that does not work, try creating a new admin user in WordPress, then log in as that user. If you stop getting the error, then the issue is with the user account you were using, and you might consider deleting it and merging all its posts to your new user account.
Otherwise, the problem is with some user metadata in WordPress that has gone bad or is corrupted. There’s no easy way to fix that, unfortunately. There is the function delete_user_meta but invoking it in special cases like yours is hard to do.
Forum: Fixing WordPress
In reply to: Can't log in to wp-adminYour site has gone bad; namely, the tool that WordPress uses to generate random numbers (for security reasons) has become polluted.
I would recommend the following steps, in order:
1. Clear all cookies and cache from your web browser, then try logging in. This may be a corrupt cookie making the random number generator throw up.
2. FTP into your site and rename or remove the Slider Revolution plugin folder from the wp-content/plugins folder. This may free you.
3. Rename all plugins in the wp-content/plugins folder.
4. Extreme measure: Download WordPress, extract it, and manually upload the files to your site.
If none of that works, you’re basically in a bad way and will likely need to reinstall your site into a fresh database. However, I am fairly sure that either step 1 or 2 will fix the problem.
Forum: Fixing WordPress
In reply to: Google mistakes my site for a wordpress site.Assuming you have access to your website server (i.e., FTP) and you have a Google account, log on to Webmaster Tools, verify that you own the site, and ask Google to re-index the site. That should fix your problem if you have deleted everything there.
Forum: Fixing WordPress
In reply to: Recent Images not loading properlyWhen I look at the Chrome browser’s developer console and visit the page you note, I see a series of 500 server errors are raised trying to access the photos you note.
In fact, trying to go to one of the pictures directly:
https://www.piperspixels.com/wp-content/uploads/2016/01/pipingsilhouettes.pngGives the error:
The page cannot be displayed because an internal server error has occurred.This error indicates that the Microsoft IIS server your website is running on has a configuration error; namely, Chrome says there is a rewrite rule that is sending requests to something incorrect.
It looks to me like your site is hosted at infoquest. I would give their tech support folks a call and ask if they can help.
Forum: Fixing WordPress
In reply to: Display template part if page has child pagesAs referenced here, you can use the child-of argument for get_pages; if it returns any number of pages, then you know the page has at least one child page.
$pages = get_pages( 'child_of=' . $post->ID ); if( false !== $pages && 0 === count($pages) ) get_template_part( 'my-template-here' );Forum: Fixing WordPress
In reply to: Adjusting MenuSorry, the order.thehalfandhalf.com site is clearly not built in WordPress, so we can’t really help you solve this problem.
I’m not sure who built it, but they are the folks you need to contact; it appears the site is hosted by MediaTemple, so perhaps they can help you track down someone who can help.
Forum: Fixing WordPress
In reply to: exclude_pages on pre_get_post seems doesn't work on WP4.4.1This is something of a stab in the dark, but I think it may be a problem with proper casting of the user ID, or perhaps $query can’t be properly set from this function.
Try this:
function exclude_this_page( &$query ) { if( !is_admin() ) return $query; global $pagenow; if( 'edit.php' == $pagenow && ( get_query_var( 'post_type' ) && 'page' == get_query_var( 'post_type' ) ) ) { get_currentuserinfo(); if( '4' == $user_ID ) $query->set( 'post__in', array( 59, 67, 115 ) ); return $query; } }Alexandre’s advice is the wise path. You should do as he suggests.
Alternatively, you can dump your old site into a new MySQL database (not your target WordPress database!) and select all published articles in the wp_posts database via this query:
SELECT * FROM wp_posts WHERE post_status = 'publish'This will give you the body text, titles, etc. of each post. You can then copy and paste them into new posts in your new WordPress post Dashboard.
If you absolutely insist on just swapping out tables, it’s probably not going to work and it’s certainly going to mess up whatever you already have.
Forum: Fixing WordPress
In reply to: Inserting Java into UrlI think you mean, you want to store some user variable and persist it across URLs so it can be retrieved in JavaScript.
The easiest way to do that is via cookies. See this W3 tutorial for more information.
Forum: Fixing WordPress
In reply to: Php script & outbound linksAny link shortener can do what you want. I am fond of YOURLS, which is written by longtime WordPress plugin developer Ozh.
Forum: Fixing WordPress
In reply to: Fatal error when add a record to WordPress tabletl:dr: Your code isn’t running inside WordPress and therefore, $wpdb is not defined. You can fix it by requiring wp-load.php prior to calling your function.
You’re getting this error because you are calling this function from outside of WordPress.
“Call to a member function insert() on a non-object” means that PHP is looking to see if $wpdb is defined as a WordPress Database Access Abstraction Object, but it is not. In fact, the way you have called it, it is basically null.
Therefore, when you set $table_name, it is actually just ‘nd_tempemails’ and when you call $wpdb->insert, PHP can’t do as you request because it has no idea what $wpdb is, other than null.
You can get access to $wpdb from outside WordPress by requiring wp-load.php. See this thread on how you can go about that, and note that how you find the path to wp-load.php depends largely on how your server is set up. That said, generally speaking this will work:
$parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] ); require_once( $parse_uri[0] . 'wp-load.php' );