gshell
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Can not get $wpdb workingThanks that is one of my issues with trying to learn how to do this, there is so much information on the internet that is out of date or does not work for a variety of reasons. It’s very time consuming to find the correct and current solutions. Any advice on quality reference materials for website and theme development would be greatly appreciated.
As to the $wpdb functions. Removing the ;’s did resolve the crashing problem, however nothing is returned. I copied the code exactly as presented in the Codex Class Reference/wpdb with the exception of replacing ‘echo’ with return as ‘echo’ does not seem to work from an external function. The function now looks like this. I temporarily added a “Got Here” just before the $user_count assignment to prove that the function was operating as expected, and it properly returned the text. But no results from the $wpdb function.
function mmmp_get_member_info() {
$user_count = $wpdb->get_var( “SELECT COUNT(*) FROM $wpdb->users” );
return “<p>User count is {$user_count}</p>”;
}Forum: Developing with WordPress
In reply to: wp_redirect issueThank You
Thank You. You are correct the result was pretty ugly. I did what you suggested and it worked perfectly. Thank You. The modification to the navigation-top.php file now looks like this:
<?php
if ( is_user_logged_in() ) {
wp_nav_menu( array(
‘theme_location’ => ‘top’,
‘menu’ => ‘logged-in-member-menu’,
) );
} else {
wp_nav_menu( array(
‘theme_location’ => ‘top’,
‘menu’ => ‘public-menu’,
) );
}
?>I’m not real sure what the difference between ‘menu’ and ‘menu-id’ is that was in the original file, but ‘menu’ works and ‘menu-id’ doesn’t.
Thank you very much.
Thanks,
But at this time, I would like to modify the child theme directly. Mostly as part of a learning experience more than anything else.