• Archive
  • RSS
  • Ask Me Anything

Attack the Hill by Tom Geoco

Actively sharing web design, development, and startup insight.

Handling Wordpress MU HTTPS Directives

We’re developing an application based on the Wordpress MU framework that needs to handle HTTPS requests separately. I’m not a subject expect, so I had to dig around to figure out the best approach for explicitly defining HTTPS rules for our mainsite versus subdomains.

Here is what I came up with:

  1. Open up your .htaccess file
  2. Enter the following rule to default your mainsite to HTTPS:
    RewriteEngine on
    RewriteCond %{HTTPS} !on
    RewriteCond %{HTTP_HOST} ^(www\.)?mainsite\.com
    RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  3. Save.

Alternatively, if you need to explicitly define subdomains with the same rule, you can use the following variation:

RewriteEngine on
RewriteCond %{HTTPS} !on
RewriteCond %{HTTP_HOST} ^((www|subdomain)\.)?mainsite\.com
RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

We opted for %HTTP_HOST% over %SERVER_NAME%. In case you’re wondering what the difference is between the two, I found a great explanation on StackOverflow.

    • #wordpress
    • #wordpress mu
    • #htaccess
    • #web development
    • #web apps
    • #https
    • #stackoverflow
    • #directives
  • 2 days ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
Credited to u/I__just__cant.
Pop-upView Separately

Credited to u/I__just__cant.

    • #Typography
    • #lettering
    • #font
    • #design
    • #hand drawn
    • #art
  • 3 days ago
  • 1
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
Pop-upView Separately
    • #risks
    • #startups
    • #entrepreneurs
    • #motivation
    • #risk management
    • #life lessons
    • #wearahelmet
  • 3 days ago
  • 16
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
Gamer or not, you’ve got to appreciate the detail that went into DOTACinema’s interactive design of their character guide YouTube series.

It’s the first time I’ve seen a design this clever on YouTube. Anyone nominate some equally awesome examples?
View Separately

Gamer or not, you’ve got to appreciate the detail that went into DOTACinema’s interactive design of their character guide YouTube series.

It’s the first time I’ve seen a design this clever on YouTube. Anyone nominate some equally awesome examples?

    • #design
    • #youtube design
    • #interactive design
    • #dota 2
    • #video design
    • #gaming
  • 4 days ago
  • 1
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Q:On your reply to my post you mentioned that you learned alone, but having other's help is huge. One of the things that me and this friend have going is a pretty phenomenal meetup community where I can throw up a question to twitter and receive a couple answers. How are Phoenix's meetups?

danhefferan

Phoenix isn’t as bustling with startups and development as you would expect a business hub our size to be.

But there are a few communities gaining some traction, specifically CO+HOOTS and Gangplank. In fact, a startup from the CO+HOOTS incubator just went onto Shark Tank a few weeks ago and received an investment from Mark Cuban, which is great for visibility.

Other than that, I went to a Javascript meetup just last week, which is the second meetup I’ve went to since I moved back here in January, and it was surprisingly good.

The development community is here, you just have to know where to look. I’m not sure how to compare it, though, as I’m coming from Hawaii, not Austin, TX or San Fran, CA.

  • 5 days ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Photoshop Etiquette for Every Designer

A designer’s guide to Photoshop-ing. This is great, and is a must-follow set of rules that I couldn’t agree with more.

    • #photoshop
    • #adobe
    • #design
    • #designers
    • #web design
    • #graphic design
  • 5 days ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

How to Call Custom Stylesheets Per Page or Category in Wordpress

On a recent project, I needed to customize the header and other CSS classes throughout individual Wordpress pages to fit category-specific color schemes. An example of this can be seen by navigating between menu items at MORE and AskMen.

This mockup outlines the header variation I was after:

image

Admittedly, I’m not an experienced PHP developer but I decided that this little trick was useful and a great way for designers to style their Wordpress themes. Feel free to refactor the end result and share your support!

Designer’s 3-Step Guide to Category-specific Stylesheets in Wordpress

  1. Create the stylesheets to be called upon.

    image

  2. In your header.php, include the following code for each stylesheet you’d like to apply before the closing of your <head>:
    <?php 
              if ( !is_home() && in_category( array( 'health-fitness', 'fitness', 'health-fitness-blogs', 'menopause', 'nutrition', 'vitaminminerals-chart', 'weight-management', 'health' ) )) { ?>
              <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/css/skins/health-skin.css" type="text/css" media="screen" />
    <?php } ?>
  3. Insert the slug-names of the categories that you would like to apply to the defined stylesheet (mine are highlighted in blue following the array).

image

Quick Q&A

How do I specify stylesheets per page?

This is a quick change to your code. Simply replace in_category('category-slug') with in_page('page-slug').

What is the difference between in_category and is_category?

As I learned during this project, in_category defines rules for posts within the defined category while is_category declares the exception specifically to that category’s view.

In other words, if you used is_category you would’ve been able to view the /category/health page with the applied stylesheet adjustments, but once you visited a post declared within that category, your styles would default to their original settings. Using in_category fixes this, and applies to the individual category pages just as well.

Read more about in_category and is_category.

Why is !is_home() declared?

When I first implemented this technique, all went well until I revisited the front page, which was a collection of posts from all categories. The expected behavior of the home page was to show the default styles, but for reasons I can’t explain, it began rendering a stylesheet from one of the defined categories.

A quick fix - and I’ll admit it may or may not be the most effective solution - was to amend an AND statement telling the output to continue only if the page was not the home page. It works for now, but if you have any better solutions, I’d love to hear them.


This isn’t the expert’s comprehensive guide to awesome PHP, but hopefully it’s helpful for designers looking to take their design techniques a step further. I hope you enjoyed it, and feel free to ask any questions or contribute to the technique.

    • #wordpress
    • #php
    • #wordpress tutorials
    • #web design
  • 5 days ago
  • 1
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Q:A while back I saw your post about designing a fullout theme for a client. How did you go about making that into an actual website? /// Which theme do you like to start from?

danhefferan

Hey there,

Thanks for following.

I think the design you are referring to was the one I did for Consumer Culture. The client needed it developed for Wordpress. In that case, I used Bones as a starting point (http://themble.com/bones/). It’s great, it’s minimal, and it gives you lots of freedom to implement any Javascript, styling, and markup that you need to.

If it were just a static web site, or if it called for it’s own specs outside of Wordpress, I would’ve used HTML5 Boilerplate w/ Modernizr (http://html5boilerplate.com/).

Hope this helps!

  • 6 days ago
  • 1
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

CSS3 Kinetic Typography

Awesome. Must implement.

    • #css3
    • #kinetic typography
    • #design
    • #web design
    • #style
  • 1 week ago
  • 1
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
think-progress:

motherjones:

kateoplis:

“Here are some broad descriptions about the generation known as Millennials: They’re narcissistic. They’re lazy. They’re coddled. They’re even a bit delusional.
Those aren’t just unfounded negative stereotypes about 80 million Americans born roughly between 1980 and 2000. They’re backed up by a decade of sociological research. The National Institutes of Health found that for people in their 20s, Narcissistic Personality Disorder is three times as high than the generation that’s 65 or older. In 1992, 80 percent of people under 23 wanted to one day have a job with greater responsibility; ten years later, 60 percent did. Millennials received so many participation trophies growing up that 40 percent of them think they should be promoted every two years – regardless of performance. They’re so hopeful about the future you might think they hadn’t heard of something called the Great Recession.”
The Me Generation

Well, they’re right about the “save us all” part, anyway.

Seconded. But Alyssa Rosenberg asks an interesting question: Why did Time put a woman on the cover?

“One avenue the choice of cover suggested is that there might be a gendered component to the irritation with Millenials. Dependence, interiority, and the careful construction of fantasy lives aren’t solely the provenance of girls and women of course, but they’re traits that are coded as feminine.”
Read more.
Pop-upView Separately

think-progress:

motherjones:

kateoplis:

“Here are some broad descriptions about the generation known as Millennials: They’re narcissistic. They’re lazy. They’re coddled. They’re even a bit delusional.

Those aren’t just unfounded negative stereotypes about 80 million Americans born roughly between 1980 and 2000. They’re backed up by a decade of sociological research. The National Institutes of Health found that for people in their 20s, Narcissistic Personality Disorder is three times as high than the generation that’s 65 or older. In 1992, 80 percent of people under 23 wanted to one day have a job with greater responsibility; ten years later, 60 percent did. Millennials received so many participation trophies growing up that 40 percent of them think they should be promoted every two years – regardless of performance. They’re so hopeful about the future you might think they hadn’t heard of something called the Great Recession.”

The Me Generation

Well, they’re right about the “save us all” part, anyway.

Seconded. But Alyssa Rosenberg asks an interesting question: Why did Time put a woman on the cover?

“One avenue the choice of cover suggested is that there might be a gendered component to the irritation with Millenials. Dependence, interiority, and the careful construction of fantasy lives aren’t solely the provenance of girls and women of course, but they’re traits that are coded as feminine.”

Read more.

(via webcommdesigns)

Source: TIME

    • #millennials
    • #time magazine
    • #future
    • #good content
  • 1 week ago > kateoplis
  • 14172
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
Page 1 of 8
← Newer • Older →

About

Avatar U.S. Marine-turned-web developer, Tom Geoco runs a web design company in Phoenix and creates really awful web applications in Python and Django when no one is looking.

Get in Touch

  • _joko on Dribbble
  • @tomgeoco on Twitter
  • Facebook Profile
  • My Skype Info
  • Linkedin Profile
  • tomgeoco on github

Twitter

loading tweets…

Following

  • grafikr
  • userexperiencehub
  • clientsfromhell
  • webcommdesigns
  • hitrecord
  • marsbot
  • mobi1canobi
  • just4inspiration
  • laughingsquid
  • cosmicdesigners
  • designersof
  • jonathanmoore
  • hoodieallen
  • philisophical-stars
  • danhefferan
  • colchrishadfield
  • drawathing
  • thedsgnblog
  • startupsbunch
  • mobileandwebdesignbunch
  • hkvn
  • nerdology
  • alexkonetchy
  • littlebigdetails
  • ashleygeoco
  • createdbyjoanna
  • nvsblty
  • zachcavender
  • uxrave
  • justinsmithchi
  • gettingtoux
  • chadhurley
  • 9eyes
  • resilientros
  • viewbookinspirations
  • aspiring-entrepreneur
  • gary
  • bjk5
  • integralslee
  • eddy-chan
  • mikeyil

Top

I Dig These Posts

See more →
  • Photo via cosmicdesigners

    Liberty Cards Karli Ingersoll

    Photo via cosmicdesigners
  • Photo via cosmicdesigners

    Toppit Badges Callum Chapman

    Photo via cosmicdesigners
  • Photo via hitrecord

    “Play”

    Photo by Anita

    Photo via hitrecord
  • Photo via grafikr

    City Guides

    Photo via grafikr
  • Photo via cosmicdesigners

    Learning Flow Wouter de Bres

    Photo via cosmicdesigners
  • RSS
  • Random
  • Archive
  • Ask Me Anything
  • Mobile

2013 © Tom Geoco.

Effector Theme by Pixel Union