• Home
  • About Mitch
  • Speaking
  • Articles
  • Contact
  • Home
  • About Mitch
  • Speaking
  • Articles
  • Contact

Digital Strategist

WordPress Developer

Content Creator

Unapologetic Punk

Mitch Canter

  • X
  • Bluesky
  • GitHub
  • Twitch
  • YouTube
  • LinkedIn
Development

Logged In? Or Not? WordPress Can Check!

CMDR Mitchcraft

Reading time: 1 minute

Today’s a quick post, but it’s worthwhile if you’re using WordPress as a Content Management System.  A lot of times people utilize the built in account system (user logins) to showcase membership data, ecommerce data, and a whole lot more.  I found a need at one point to show different data to people depending on whether or not they were logged in.  Turns out, WordPress has a built in function for it:

[code]

<?php
if ( is_user_logged_in() ) { ?>
<!–Logged In Stuff–>
<?php } else { ?>
<!–Logged Out Stuff–>
<?php } ?>

[/code]

You could replace those with menus to have separate menus that show up depending on whether you are logged in or not.  You could even have a log-in button for people who aren’t logged in, and a welcome text message for anyone who is.  The possibilities are endless, and it’s as simple as pasting the template tag into your theme files.

conditional tags, logged in, logged out, WordPress
  • WordPress.com Announces Premium Themes

    WordPress.com Announces Premium Themes

    Reading time: 1 minute

    News from the WordPress.com blog – premium themes are becoming available to WordPress.com subscribers. I am proud to introduce the very first two premium themes on WordPress.com: Headlines and Shelf. Headlines is a sophisticated magazine theme from WooThemes with a Featured Post slideshow, multiple menus, and 15 beautiful color schemes. It’s available now for a…

    WordPress
  • WordPress 2.6: The Tour

    WordPress 2.6: The Tour

    Reading time: 1 minute

    For your viewing pleasure, and because I’ve had the lovely honor to update this morning, here is a “best of the best” video (and a link to the full post) as to what to expect for WordPress 2.6 (Tyner).  Enjoy!

    WordPress