• 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
  • 3+ Things Every Content Creator Needs In 2020

    3+ Things Every Content Creator Needs In 2020

    Reading time: 3 minutes

    There is no better time to stake your claim online. The Internet, one thought to be a ‘passing fad‘, is still here and going stronger than ever. But it’s not enough to just put your voice out on every social media platform you come across. In order to truly succeed online, there are certain necessities…

    Digital Strategy, WordPress
  • How to Add Rainbow Text To WordPress

    How to Add Rainbow Text To WordPress

    Reading time: 1 minute

    I’ve been tinkering with the theme on this website, and I’m been very happy with how things have come out. I have a soft spot for gradients, especially with the ‘punk’ color scheme I’ve been using on my branding. One question I get, consistently: “How can I achieve the rainbow gradient text effect”? It’s actually…

    Design, Tutorial, WordPress