Tinkering

The thing I love the most about my personal site is just tinkering away at it over time.

I wanted to put a little box at the end of proper posts—y’know like css stuff—so if someone liked reading it, the could see about me and the agency.

A blue box that reads: 👋 Hello, I’m Andy and I’ll help you build fast & visually stunning websites.
I’m the founder of Set Studio, a creative agency that specialises in building stunning websites that work for everyone. If you’ve got a project in mind, get in touch.
My new little box

I only wanted to show it only if my post was in a couple of defined categories, so I slung a bit of PHP and HTML together:

<?php
  $allowedCount = array_filter(get_the_category(), function($cat) {
    $allowedCategories = ['CSS', 'Agency', 'Design', 'Development'];
    return in_array($cat->name, $allowedCategories);
  });
?>
<?php if(count($allowedCount) > 0): ?>
  <div class="bg-primary-glare p-m flow">
    <p>👋 Hello, I’m Andy and I’ll help you build fast & visually stunning websites.</p>
    <p>I’m the founder of <a href="https://set.studio">Set Studio</a>, a creative agency that specialises in building stunning websites that work for <strong>everyone</strong>. If you’ve got a project in mind, <a href="mailto:andy@set.studio">get in touch</a>.</p>
  </div>
  <hr />
<?php endif; ?>

I added a utility class or two and job done! A nice little box that only shows on the right sort of posts.

👋 Hello, I’m Andy and I’ll help you build fast & visually stunning websites.

I’m the founder of Set Studio, a creative agency that specialises in building stunning websites that work for everyone. If you’ve got a project in mind, get in touch.


Back to blog