• 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
  • iPhone Theme for WordPress

    iPhone Theme for WordPress

    Reading time: 1 minute

    Now that everyone and their mother has gone out and bought a shiny new iPhone (yesterday was the 3G iPhone’s release date, after all), it’s time you made your WordPress theme a bit more iPhone friendly.

    WordPress
  • Things I Learned from #wcatl (and a Few I Learned on My Own)

    Things I Learned from #wcatl (and a Few I Learned on My Own)

    Reading time: 1 minute

    View more documents from Jane Wells. 2. The PHP and WordPress communities can learn a lot from each other. @technosailor gave a fantastic presentation (re: lecture in a discussion-y way) on how the core communities of both the PHP world and the WordPress world could stand to play nicer to each other.  Personally, I think…

    WordPress