Forum Replies Created
-
AuthorPosts
-
Kim ParsellMember
First, double-check that you have the user ID correct. If you have deleted any users, then user 5 may not exist.
Try this code and see if it works:
$usersarray = $wpdb->get_results( "SELECT user_email FROM $wpdb->users WHERE ID=5" ); echo $usersarray->user_email;
More info on SELECT statements in $wpdb and examples can be found in the Codex: Codex.
The preferred way to get this information is to use the function get_userdata:
$usersarray = get_userdata(5); $useremail = $user_info->user_email; echo "$useremail";
There are so many existing functions in WordPress that will retrieve data for you rather than having to do a $wpdb query. Check the Function Reference for the user and author functions.
Hope this helps. 🙂
Just a simple country girl | Twitter
April 1, 2013 at 4:04 am in reply to: PLEASE HELP: I want "read more" buttons – NOT text links #32407Kim ParsellMemberThe issue may be with the second function (remove_more_jump_link($link)). It works fine on my site, but you may have code, either in a plugin or functions.php, that is conflicting with it.
The first function is one from the StudioPress snippets section to change the text of the more link, so shouldn't be causing a problem. If you've got the text the way you want it, I wouldn't worry about it.
Just a simple country girl | Twitter
March 30, 2013 at 11:15 pm in reply to: PLEASE HELP: I want "read more" buttons – NOT text links #32192Kim ParsellMemberYou're most welcome. 🙂
When you try again tomorrow, rather than deleting the Sample theme folder, simply rename the folder to old-sample. That will still disable the theme, forcing WordPress back to the default theme, and hopefully allowing you in, without losing any of your customizations.
To disable W3 Total Cache, go to the plugins folder and rename the folder by adding old- to the beginning of the folder name.
Just a simple country girl | Twitter
March 30, 2013 at 10:40 pm in reply to: PLEASE HELP: I want "read more" buttons – NOT text links #32190Kim ParsellMemberOkay, I've edited the code above so you can keep your current mods, but remove what was added.
Copy and paste the following into functions.php:
<?php // Start the engine require_once( get_template_directory() . '/lib/init.php' ); // Child theme (do not remove) define( 'CHILD_THEME_NAME', 'Genesis Sample Theme' ); define( 'CHILD_THEME_URL', 'http://www.studiopress.com/' ); // Add Viewport meta tag for mobile browsers add_action( 'genesis_meta', 'sample_viewport_meta_tag' ); function sample_viewport_meta_tag() { echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>'; } // Add support for custom background add_theme_support( 'custom-background' ); // Add support for custom header add_theme_support( 'genesis-custom-header', array( 'width' => 1152, 'height' => 120 ) ); // Add support for 3-column footer widgets add_theme_support( 'genesis-footer-widgets', 3 ); // Register newsletter widget area genesis_register_sidebar( array( 'id' => 'newsletter', 'name' => __( 'Newsletter', 'custom-theme' ), 'description' => __( 'This is the newsletter section.', 'custom-theme' ), ) ); // Add the newsletter widget after the post content add_action( 'genesis_after_post_content', 'custom_add_newsletter_box' ); function custom_add_newsletter_box() { if ( is_singular( 'post' ) ) genesis_widget_area( 'newsletter', array( 'before' => '<div id="newsletter">', ) ); } /** Modify the speak your mind text */ add_filter( 'genesis_comment_form_args', 'custom_comment_form_args' ); function custom_comment_form_args($args) { $args['title_reply'] = 'Leave a Comment'; return $args; } /** * Remove website field from Comments Form * * @param array $args Comments form arguments. * @return array $args Modified Comments form arguments. */ add_filter( 'genesis_comment_form_args', 'wps_comment_form_args' ); function wps_comment_form_args( $args ) { unset( $args['fields']['url'] ); return $args; } /** Register widget areas */ genesis_register_sidebar( array( 'id' => 'after-post-ad', 'name' => __( 'After Post Ad', 'themename' ), 'description' => __( 'This is a widget area that can be placed after the post', 'themename' ), ) ); add_action( 'genesis_after_post_content', 'my_widget_after_post' ); function my_widget_after_post() { if ( ! is_singular( 'post' ) ) return; genesis_widget_area( 'after-post-ad', array( 'before' => '<div class="after-post widget-area">', ) ); } /** Load Google fonts */ add_action( 'wp_enqueue_scripts', 'custom_load_google_fonts' ); function custom_load_google_fonts() { wp_enqueue_style( 'google-fonts', 'http://fonts.googleapis.com/css?family=Open+Sans’, array(), PARENT_THEME_VERSION ); } add_filter( 'genesis_comment_form_args', 'url_filtered' ); add_filter( 'comment_form_default_fields', 'url_filtered' ); function url_filtered( $fields ) { if ( isset( $fields['url'] ) ) unset( $fields['url'] ); if ( isset( $fields['fields']['url'] ) ) unset( $fields['fields']['url'] ); return $fields; }
That should get you back to where you were before you edited the file.
Just a simple country girl | Twitter
March 30, 2013 at 10:22 pm in reply to: PLEASE HELP: I want "read more" buttons – NOT text links #32187Kim ParsellMemberNo, I'm going to walk you through fixing this yourself. It's not a good idea to give your cPanel credentials strangers. 😉
Open functions.php inside the Sample child theme folder, delete all the code in it, and paste this code into it:
<?php // Start the engine require_once( get_template_directory() . '/lib/init.php' ); // Child theme (do not remove) define( 'CHILD_THEME_NAME', 'Genesis Sample Theme' ); define( 'CHILD_THEME_URL', 'http://www.studiopress.com/' ); // Add Viewport meta tag for mobile browsers add_action( 'genesis_meta', 'sample_viewport_meta_tag' ); function sample_viewport_meta_tag() { echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>'; } // Add support for custom background add_theme_support( 'custom-background' ); // Add support for custom header add_theme_support( 'genesis-custom-header', array( 'width' => 1152, 'height' => 120 ) ); // Add support for 3-column footer widgets add_theme_support( 'genesis-footer-widgets', 3 );
The above code is the original contents of the functions.php file. Save the file and try to access wp-admin again.
If the above does not fix your problem, go up one level in the file directory to the /wp-content/themes/ folder, then delete only the Sample child theme folder. This will force WordPress back to the default theme and you should be able to log in again.
Just a simple country girl | Twitter
March 30, 2013 at 10:04 pm in reply to: PLEASE HELP: I want "read more" buttons – NOT text links #32185Kim ParsellMemberYou can't disable individual plugins via Cpanel, only delete them.
Was functions.php the only file you edited?
Just a simple country girl | Twitter
March 30, 2013 at 9:50 pm in reply to: PLEASE HELP: I want "read more" buttons – NOT text links #32183Kim ParsellMemberYes, there's a very good chance that W3 Total Cache is causing an issue. Can you disable it until you get the changes made and working right?
And make sure that you add the code to your functions.php file after the last closing bracket from the previous function.
Just a simple country girl | Twitter
March 30, 2013 at 9:47 pm in reply to: PLEASE HELP: I want "read more" buttons – NOT text links #32182Kim ParsellMemberApparently the forum didn't like my use of the actual more tag in my reply. First paragraph should read:
Smashing Magazine is using the more tag in their posts to set up the Read more… link, and styling that link to look like a button.
Place the more tag in your post at the end of what you want the excerpt to be.
Holler if you have any more questions. 🙂
Just a simple country girl | Twitter
March 30, 2013 at 8:45 pm in reply to: PLEASE HELP: I want "read more" buttons – NOT text links #32177Kim ParsellMemberSmashing Magazine is using the [Read more...] about Kim Parsell