Skip to content

Instantly share code, notes, and snippets.

@zackn9ne
Created July 16, 2012 17:45
Show Gist options
  • Save zackn9ne/3123975 to your computer and use it in GitHub Desktop.
Save zackn9ne/3123975 to your computer and use it in GitHub Desktop.
WordPress PHP if Else
<?php if(is_category(10)): ?>
some html
<?php else: ?>
other html
<?php endif; ?>
@hslavich
Copy link

@zackn9ne
Copy link
Author

I just do it that way so I can put standard HTML in between the curly braces and break out of PHP and back in for the next condition.

@hslavich
Copy link

some html

other html

This way is better, no braces, more html friendly :)

@zackn9ne
Copy link
Author

gist updated XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment