How would I make a function to dynamically determine if user is logged to change navigation menu text?

I’m not really sure what you’re trying to achieve with the is_page parts – maybe I’m missing something – but what if you’d just write: if (is_user_logged_in()) { $my_account = “My Account”; echo ($my_account); } else { $login = “Login/Sign Up”; echo ($login); } return just returns the variables for use in your code, echo … Read more

How to add a shortcode to call a function

So you’re just looking for a simple shortcode that will call an existing function? The following will create the shortcode you’re looking for, but admittedly I haven’t tested it with the Cimy User Extra Fields plugin. Add this to functions.php and try it out: function shortcode_cimyFieldValue( $atts ) { global $current_user; $user_id = ( is_user_logged_in() … Read more

hook for dashboard show_user_profile

show_user_profile is the wrong hook to use. You should redirect before anything gets sent to the browser (eg. before headers are sent). Fortunately there are actions that happen much earlier: load-{$pagename} is the one you want. So you can hook into load-index.php and load-profile.php to throw people back to the front end. <?php add_action( ‘load-profile.php’, … Read more